예제 #1
0
        public override void Alter(ActionCall call)
        {
            var entityType = _entityType ?? call.HandlerType.GetEntityType();

            var role = CrudRules.SecurableNameForCreation(entityType);

            call.ParentChain().Authorization.AddRole(role);
        }
예제 #2
0
 private void addCreationPermission(ActionCall action)
 {
     // If there are no other permissioning, add one
     if (!action.HasAttribute <AuthorizationAttribute>())
     {
         var permissionName = CrudRules.SecurableNameForCreation(_entityType);
         action.ParentChain().Authorization.AddRole(permissionName);
     }
 }