Exemplo n.º 1
0
 public static bool OwnsResource(this ClaimsPrincipal user, IOwnedResource resource)
 {
     return(user.Identity.Name == resource.OwnerLogin);
 }
Exemplo n.º 2
0
 public static async Task <bool> AuthorizeEditAsync(
     this IAuthorizationService authorizationService,
     ClaimsPrincipal user,
     IOwnedResource resource) =>
 (await authorizationService.AuthorizeAsync(user, resource, Policy.Edit)).Succeeded;