The Get(), GetAll(), Create(), Update() and Delete() functions in the CrudAppServiceBase check if the user is authorized before executing otherwise throws an exception.
Each function uses a predefined PermissionName which, by default, is set to an empty string which is ignored and authorization allowed.
The predefined names are:
- GetPermissionName
- GetAllPermissionName
- CreatePermissionName
- UpdatePermissionName
- DeletePermissionName
To use these set the appropriate PermissionName to the permission you defined in .Core/Authroization/PermissionNames.cs
Don't forget to include the function to check authorization as the first line of code in your overriding function.
They are:
- CheckGetPermission()
- CheckGetAllPermission()
- CheckCreatePermission()
- CheckUpdatePermission()
- CheckDeletePermission()