Hi,
We're using ABP Zero Template version 10.0.0.0. We added a new method AddNewPermission() in PermissionAppService.cs to create a new permission from the database table.
Below is the sample code
PermissionAppService.cs: public void AddNewPermission(ImportLogData permissionDto) { var permissionProvider = new AppAuthorizationProvider(true); permissionProvider.AddPermission(_permissionDefinitionContext, permissionDto.Message); }
AppAuthorizationProvider.cs: public void AddPermission(IPermissionDefinitionContext context, string permissionName) { var myGroup = context.GetPermissionOrNull("Pages.Reports"); myGroup?.CreateChildPermission(permissionName, new FixedLocalizableString(permissionName)); }
We're unable to access the method in the application. Please review the screenshots below for reference.
<br> Could you help us how to add a new permission from the database table into SetPermissions() in AppAuthorizationProvider.cs?
Regards, Vidyadhar