bill
This commit is contained in:
parent
08606c106b
commit
a120dae977
144 changed files with 10574 additions and 1527 deletions
19
Yavsc/AuthorizationHandlers/BillEditHandler.cs
Normal file
19
Yavsc/AuthorizationHandlers/BillEditHandler.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using System.Security.Claims;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
|
||||
namespace Yavsc.ViewModels.Auth.Handlers
|
||||
{
|
||||
using Billing;
|
||||
public class BillEditHandler : AuthorizationHandler<EditRequirement, IBillable>
|
||||
{
|
||||
protected override void Handle(AuthorizationContext context, EditRequirement requirement, IBillable resource)
|
||||
{
|
||||
if (context.User.IsInRole("FrontOffice"))
|
||||
context.Succeed(requirement);
|
||||
else if (context.User.Identity.IsAuthenticated)
|
||||
if (resource.ClientId == context.User.GetUserId())
|
||||
context.Succeed(requirement);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue