Is it possible to create a dynamic role based on a static role ? CORA AI gave me an example, but it doesn't work

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Is it possible to create a dynamic role based on a static role ? CORA AI gave me an example, but it doesn't work

L0 Member
// Check if user is a member of a specific role if (User.Roles && User.Roles.length > 0) { for (var i = 0; i < User.Roles.length; i++) { if (User.Roles[i].Name === 'Target Role Name') { return true; } } } return false;

 

1 accepted solution

Accepted Solutions

L3 Networker

After checking with our internal teams, we do not believe this is possible because as it doesn't have access to the full user information which would include roles. In other words, ironically this role scripting feature doesn't know what roles you're in. If your use case is something like "If user is in role A, put in role B," then you can simply nest the roles though.

View solution in original post

2 REPLIES 2

L3 Networker

After checking with our internal teams, we do not believe this is possible because as it doesn't have access to the full user information which would include roles. In other words, ironically this role scripting feature doesn't know what roles you're in. If your use case is something like "If user is in role A, put in role B," then you can simply nest the roles though.

L0 Member

Hello Jaime

 

Thank you for your answer

 

Best Regards

Pierryck

  • 1 accepted solution
  • 80 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!