Get all roles from security database in Marklgoic

44 Views Asked by At

I am trying the get roles from security database but i am not able to get all roles, it seems that Compartment role i am not getting, below is the query i am trying.

for  $ids in xdmp:get-current-roles()
let $Rolename := xdmp:role-name($ids)
return $Rolename

Can anyone suggest how can I achieve this, I want to get all the roles within security database

1

There are 1 best solutions below

0
On BEST ANSWER

xdmp:get-current-roles() will only return the roles assigned and inherited by the current user.

In order to list all roles in the Security DB, use xdmp:roles()

for  $ids in xdmp:roles()
let $Rolename := xdmp:role-name($ids)
return $Rolename