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)); }
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)); }
public virtual bool IsGranted(AclRight right, object grantedTo = null, object grantedOn = null) { throw new NotImplementedException(); }