Get RolePermission data

Vote:
 

[Working on Episerver version 10]

I am working on a Gadget for our system administrators that will show given role x, which permissions that role has.  The string to be translated to fetch the access permission is located in the dbo.RolePermission table in Epi Commerce database.

What is the best way to retireve the data from this table in code?

#204080
May 17, 2019 22:04
Vote:
 

It is a CMS question, really.

You can use PermissionTypeRepository to get the registered PermissionTypes, then PermissionRepository to figure out which groups/users have a specific permission 

#204083
May 17, 2019 23:20
Vote:
 

Quan Mai,

are their any code examples of this? i am having trouble finding them

#204084
May 17, 2019 23:32
Vote:
 

Quan Mai,

i believe I am looking for the inverse.

I want the input to be a group, like "Administrator" then, i want the gadget to list all of the permissions for that group.

Not sure the above suggestion will work because you send it a permissions type and it returns a list of users/groups that have that specific permission. 

#204085
May 17, 2019 23:40
Vote:
 

You can write some code to reverse that as you already have a list of permission types and the users/groups attached to them. 

Here's a hint https://vimvq1987.com/listing-permissions-per-user-group/ 

#204089
May 18, 2019 23:17
Vote:
 

This can be closed.

Thanks for your help Quan Mai!

#204223
May 22, 2019 19:58
Vote:
 

Just a small note: this is the public community forum so if you find a post answers your question, you can click on "Accept this answer" (you can also figure out the answer yourself, post it here and accept it). You can also vote up a good post (or vote down a vote that you think could be better). That way we build a better community for all.

#204224
May 22, 2019 20:33