Esempio n. 1
0
 public bool IsGranted(AclRight right, object grantedTo = null, object grantedOn = null)
 {
     if (Connection == null)
     {
         return(false);
     }
     if (Connection.User.Login == "admin")
     {
         return(true);
     }
     if (right == null)
     {
         return(true);
     }
     return(CurrentRights.Contains(right));
 }
Esempio n. 2
0
        public async Task <bool> IsGrantedV2(AclRight right, object grantedTo, object grantedOn = null)
        {
            var toNode = await GetAclNode(grantedTo).ConfigureAwait(false);

            var onNode = await GetAclNode(grantedOn).ConfigureAwait(false);

            //TODO : should it be false or true (or exception)
            if (toNode == null)
            {
                return(false);
            }
            if (onNode == null)
            {
                return(false);
            }

            return(await toNode.IsGrantedAsync(right, onNode).ConfigureAwait(false));
        }
Esempio n. 3
0
 public virtual bool IsGranted(AclRight right, object grantedTo = null, object grantedOn = null)
 {
     throw new NotImplementedException();
 }