Reputation: 82
I'm studying the use of ASP.NET Boilerplate and I've noticed that the ASP.NET Boilerplate authorization mechanism uses Attributes like this:
[AbpAuthorize("CanDeletePerson")]
public async Task DeletePerson(EntityDto input)
{
await _personRepository.DeleteAsync(input.Id);
}
Let's say for example a person named 'Clay' who has the CanDeletePerson
permission set. Then subsequently this permission is removed. How do I add back the permission?
Is there some administration system / UI set-up in the free Abp templates that allows for the configuration and maintenance of User Permissions?
Upvotes: 0
Views: 3303
Reputation: 437
First you have to add permission to DB, by code you can follow these steps:
In File .Core\Authorization\AspNetMvc5StartUpTemplateAuthorizationProvider.cs, add a line:
context.CreatePermission("CanDeletePerson", L("CanDeletePerson"));
Add localization text in .Core\Localization\Source
Hope it help. Cheers
Upvotes: 1
Reputation: 5791
As far as I am aware only the premium template has a pre-built UI for you to use from the outset.
With the free version we have to build Permission admin pages ourselves.
There is a class called 'HostRoleAndUserCreator'. Find that class and you will see how RolePermissionSetting are persisted/initialised.
You will also see from your MyAppAuthorizationProvider how permissions themselves are seeded.
Upvotes: 0