bill
This commit is contained in:
parent
08606c106b
commit
a120dae977
144 changed files with 10574 additions and 1527 deletions
17
Yavsc/AuthorizationHandlers/HasBadgeHandler.cs
Normal file
17
Yavsc/AuthorizationHandlers/HasBadgeHandler.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using Microsoft.AspNet.Authorization;
|
||||
|
||||
namespace Yavsc.ViewModels.Auth.Handlers
|
||||
{
|
||||
public class HasBadgeHandler : AuthorizationHandler<PrivateChatEntryRequirement>
|
||||
{
|
||||
protected override void Handle(AuthorizationContext context, PrivateChatEntryRequirement requirement)
|
||||
{
|
||||
if (!context.User.HasClaim(c => c.Type == "BadgeNumber" &&
|
||||
c.Issuer == Startup.Authority))
|
||||
{
|
||||
return;
|
||||
}
|
||||
context.Succeed(requirement);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue