estimate view authorization
This commit is contained in:
parent
5bf8bff62a
commit
5159723eab
7 changed files with 71 additions and 28 deletions
|
|
@ -8,7 +8,8 @@ namespace Yavsc.ViewModels.Auth
|
|||
{
|
||||
protected override void Handle(AuthorizationContext context, ViewRequirement requirement, Blog resource)
|
||||
{
|
||||
if (context.User.IsInRole("Moderator"))
|
||||
if (context.User.IsInRole(Constants.BlogModeratorGroupName)
|
||||
|| context.User.IsInRole(Constants.AdminGroupName))
|
||||
context.Succeed(requirement);
|
||||
else if (context.User.Identity.IsAuthenticated)
|
||||
if (resource.AuthorId == context.User.GetUserId())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue