Hi There, I was trying to implement authorization in asp.net boiler plate. I followed below steps Database
Id Name IsGranted CreationTime CreatorUserId RoleId UserId Discriminator TenantId 119 Pages.Roles 1 59:59.9 2 4 Null Pages.Roles 1 120 Pages.Roles.Dashboard 1 59:59.9 2 4 Null Pages.Roles.Dashboard 1 121 Pages.Roles.Dashboard.ToDoList 1 59:59.9 2 4 Null Pages.Roles.Dashboard.ToDoList 1 122 Pages.Roles.Dashboard.Notifications 1 59:59.9 2 4 Null Pages.Roles.Dashboard.Notifications 1
Front end Code. 4. Added constant variable under "Code.Authorization.PermissionNames" as Below public const string Pages_Roles = "Pages.Roles"; public const string Pages_Roles_Dashboard = "Pages.Roles.Dashboard"; public const string Pages_Roles_Dashboard_ToDoList = "Pages.Roles.Dashboard.ToDoList"; public const string Pages_Roles_Dashboard_Notifications = "Pages.Roles.Dashboard.Notifications";
Result - Now when i log in by the user assigned this id (4-Account) the permissions are not granted to him.
Please Help me.
Thanks and Regards Om Prakash
Hi There, I am facing problem with implementing role base authorization in asp.net boilerplate. Tried the below steps. Database
Code, 4. I added constant string variable in "Core.Authorization.PermissionNames" class. 5. Then In "Core.Authorization.FinanceAuthorizationProvider:AuthorizationProvider " class i set the permission in "SetPermissions" method as below.
public override void SetPermissions(IPermissionDefinitionContext context) { //Common permissions var pages = context.GetPermissionOrNull(PermissionNames.Pages); if (pages == null) { pages = context.CreatePermission(PermissionNames.Pages, L("Pages")); } var users = pages.CreateChildPermission(PermissionNames.Pages_Users, L("Users")); var roles = pages.CreateChildPermission(PermissionNames.Pages_Roles, L("Roles")); }
-- Now when i log in with the users having Accounts, Sales Roles. Not able to get "Role" permission..
Please help.
Thanks and Regards Om Prakash