Base solution for your next web application
Open Closed

Granting Permissions based on Role not working #2508


User avatar
0
ramansharma252 created

The PermissionName table has all the custom permission names as per RoleID.

When the admin changes the Role of the user to other RoleID the AbpUserRoles table gets the updated id.

Based on the ID associated with the Roles the user on Login are Granted the Permission Names that are associated with that RoleID using the method " UpdateRolePermissions".

When changing the Role from RoleId 1 to RoleId 2,the pages are displayed as per permissionNames. Just logging out and logging as admin and again changing the RoleID to 1 of that user,the PermissionNames are not granted as per updated RoleID(i.e RoleID=1).It still shows the pages of RoleId 2.

Also tried assigning the Permissions one by one using Role based and User based. Still not reflecting.

Any clue to what went wrong.


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If I understand it correctly, the user whose role is changed is not logged out and logged in right ? Since permissions are cached, the user whose role is changed must log out and log in in order to take affect of this change. Or you can clean the cache for permissions after changing the user's role.