0
acmeware created
Hi, I need to create a method to override certain permissions regardless of what is in the table.
In my UserManager.cs I added this hard-code to test out where to do this. It is not working, the user still has permission to this page. Where should I override permissions in this way if not here?
public override async Task<bool> IsGrantedAsync(long userId, Permission permission)
{
if (permission.Name == "Pages.ConnectionLogs.Create")
{
return false;
}
return await base.IsGrantedAsync(userId, permission);
}
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
2 Answer(s)
-
0
hi
Please try to override the synchronization method at the same time
public virtual bool IsGranted(long userId, Permission permission)Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Perfect. Thanks!
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)