Role in Outsystems

Role in Outsystems

  

Hi All,

After assigning role to user though the OUTSYSTEM platform, can i use the aggregate by UserId to know the role that user has been assigned?

Hi, when you created role on Service Studio yes a function already created to check role privilege

If you just want to know "Does this {UserId} have role {TheRole}", you can use Check{TheRole} as described above.

If you need to know "Which are the users that have role {TheRole}", then you will need to use an aggregate. On the aggregate, you can use the CheckRole function on a filter, such as "CheckRole(User.Id, Roles.{TheRole}) = True".