• CMS,  Episerver

    Listing permissions per user/group

    This week I came cross this question on Episerver World forum https://world.episerver.com/forum/developer-forum/Episerver-Commerce/Thread-Container/2019/5/get-rolepermission-data/ , and while it is not Commerce-related. it is quite interesting to solve. Perhaps this short post will help the original poster, as well future visitors. As in the thread, I replied the first piece to solve the puzzle: You can use¬†PermissionTypeRepository to get the registered PermissionTypes, then¬†PermissionRepository to figure out which groups/users have a specific permission¬† If you want to list permissions granted to a specific role or user, it is just a simple reversion using a dictionary: As suggested above, we use PermissionTypeRepository to list the registered PermissionType(s) , and then for each PermissionType we get…