Creating a Dynamic Role
Application Type
Reactive
Service Studio Version
11.14.8 (Build 58515)

Hi All,


I have a requirement to create roles dynamically.

I did achieve that by creating own application role and ignoring the System Role. Also, I have created a server action to check whether the logged in person belongs to any of the roles.

Example:- On role check I am exposing menu (User & Role) by setting Visible property value with variables (True/False).

Considering I have two roles created in RoleApp Entity

RoleApp Entity

Problem:- In my logic I'm still ending with fixed role check based on If condition and its not dynamic . Because in future we might add few more Roles, so again I will end up with code change to add If condition to check.

Attached in the OML file for reference.

Regards,

Vinod

Users_And_Roles_App.oml

Hi Vinod,

why don't you use a For Each for the entire list of roles and inside the for each verify if the roles exist for that user?

Regards

Hi Jose,


Thanks for your response.


We can check the roles exist for that user, but how dynamically we can check the condition for this role I need to expose particular item. Example Menu item.

@Rakshitha U

Regards,

Vinod  

Not possible to create platform roles at runtime. Roles can only be created during development.

You should implement part of your access control mechanism with custom code if you need that.



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.