public void Merge(AccessControlEntry entry)
 {
     this.Create = MergePermission(this.Create, entry.Create);
     this.Read   = MergePermission(this.Read, entry.Read);
     this.Update = MergePermission(this.Update, entry.Update);
     this.Delete = MergePermission(this.Delete, entry.Delete);
 }
        public static AccessControlEntry Inherit(AccessControlEntry entry)
        {
            AccessControlEntry newEntry = new AccessControlEntry(entry);

            newEntry.IsInherit = true;
            return(newEntry);
        }
 public AccessControlEntry(AccessControlEntry entry)
 {
     Id     = entry.Id;
     Name   = entry.Name;
     Create = entry.Create;
     Update = entry.Update;
     Read   = entry.Read;
     Delete = entry.Delete;
 }
Exemple #4
0
        public void MergeEntry(AccessControlEntry entry)
        {
            AccessControlEntry existing = Entries.FirstOrDefault(a => a.Id == entry.Id);

            if (existing == null)
            {
                Entries.Add(entry);
            }
            else
            {
                existing.Merge(entry);
            }
        }
 public bool DiffersFrom(AccessControlEntry entry)
 {
     return((entry == null) || (Id != entry.Id) || (Read != entry.Read) || (Create != entry.Create) || (Update != entry.Update) || (Delete != entry.Delete));
 }