Beispiel #1
0
 public Ability(IConfigurationLogger logger)
 {
     this.logger    = logger;
     permissions    = new List <Permission>();
     actionCleaner  = new ActionCleaner(logger);
     subjectCleaner = new SubjectCleaner(logger);
 }
Beispiel #2
0
 public Ability()
 {
     permissions        = new List <Permission>();
     actionCleaner      = new ActionCleaner();
     subjectCleaner     = new SubjectCleaner();
     commandConventions = new List <string>();
 }
Beispiel #3
0
        public StringBasedPermission(string action, string subject, ActionCleaner actionCleaner, SubjectCleaner subjectCleaner)
        {
            this.actionCleaner  = actionCleaner;
            this.subjectCleaner = subjectCleaner;
            AllowedAction       = actionCleaner.Clean(action);
            AllowedSubject      = subjectCleaner.Clean(subject);

            authorizationPredicates = new List <IAuthorizationPredicate>();
        }
Beispiel #4
0
        public Permission(string action, string subject, ActionCleaner actionCleaner, SubjectCleaner subjectCleaner, IEnumerable <string> commandConventions)
        {
            this.actionCleaner      = actionCleaner;
            this.subjectCleaner     = subjectCleaner;
            this.commandConventions = commandConventions;
            Action  = actionCleaner.Clean(action);
            Subject = subjectCleaner.Clean(subject);

            authorizationPredicates = new List <IAuthorizationPredicate>();
        }
 public TypedPermission(string action, Func <T, bool> predicate, ActionCleaner actionCleaner)
 {
     AllowedAction      = actionCleaner.Clean(action);
     this.predicate     = predicate;
     this.actionCleaner = actionCleaner;
 }