Пример #1
0
        public override bool Equals(object obj)
        {
            RbacPermission otherPermission = obj as RbacPermission;

            if (obj == null)
            {
                return(false);
            }
            return(Name == otherPermission.Name);
        }
Пример #2
0
 public bool HasPermission(RbacPermission permission)
 {
     return(Permissions.Contains(permission) || SubRoles.Any((RbacRole obj) => obj.HasPermission(permission)));
 }
Пример #3
0
 /// <summary>
 /// Recursively works out whether this user has the specified permission.
 /// </summary>
 /// <param name="permission">The permission to search for.</param>
 /// <returns>Whether this user has the specified permission through one of their roles or not.</returns>
 public bool HasPermission(RbacPermission permission)
 {
     return(Roles.Any((RbacRole role) => role.HasPermission(permission)));
 }