Beispiel #1
0
        internal AclEditor SetPermission(int principalId, bool propagates, PermissionType permissionType, PermissionValue permissionValue)
        {
            var  entry = GetEntry(principalId, propagates);
            var  perm  = GetSnPerm(entry, permissionType);
            uint allowBits;
            uint denyBits;

            entry.GetPermissionBits(out allowBits, out denyBits);
            PermissionBits.SetBits(ref allowBits, ref denyBits, permissionType, permissionValue);
            entry.SetPermissionsBits(allowBits, denyBits);
            return(this);
        }
Beispiel #2
0
        internal void AddEntry(SnAccessControlEntry entry)
        {
            var  newEntry = CreateEntry(entry.Identity.NodeId, entry.Propagates);
            uint allowBits, denyBits;

            entry.GetPermissionBits(out allowBits, out denyBits);
            PermissionBits.SetBits(ref allowBits, ref denyBits);
            newEntry.SetPermissionsBits(allowBits, denyBits);
            var list = acl.Entries.ToList();

            list.Add(newEntry);
            acl.Entries = list.ToArray();
        }