chatRooms
This commit is contained in:
parent
86130d2ee5
commit
871cf6b884
42 changed files with 15345 additions and 225 deletions
|
|
@ -1,10 +1,14 @@
|
|||
using Microsoft.AspNet.Authorization;
|
||||
|
||||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
public abstract class Rule<TResource> where TResource : IAuthorizationRequirement
|
||||
public abstract class Rule<TResource,TRequirement>
|
||||
{
|
||||
public virtual bool Mandatory { get; set; }
|
||||
public abstract bool Allow(ApplicationUser user);
|
||||
public Rule()
|
||||
{
|
||||
|
||||
}
|
||||
// Abstract method to compute any authorization on a resource
|
||||
public abstract bool Allow(ApplicationDbContext context, string userId, TResource resource, TRequirement requirement);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
|
||||
namespace Yavsc.Models.Access
|
||||
{
|
||||
public abstract class RuleSet <TResource,TRequirement>:List<Rule<TResource,TRequirement>> {
|
||||
|
||||
public class RuleSet <TResource>:List<Rule<TResource>> where TResource : IAuthorizationRequirement{
|
||||
|
||||
bool Allow(ApplicationUser user)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public abstract bool Allow(ApplicationDbContext context, string userId, TResource resource, TRequirement requirement);
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue