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

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

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

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