//============================================================================= for editing internal SnAccessControlList GetAcl(int nodeId, string path, int creatorId, int lastModifierId) { var acl = new SnAccessControlList { Path = path, NodeId = nodeId, Creator = SnIdentity.Create(creatorId), LastModifier = SnIdentity.Create(lastModifierId) }; var firstPermInfo = GetFirstInfo(path); if (firstPermInfo == null) { return(acl); } return(firstPermInfo.BuildAcl(acl)); }
public static SnAccessControlEntry CreateEmpty(int principalId, bool propagates) { var perms = new List <SnPermission>(); foreach (var permType in ActiveSchema.PermissionTypes) // .OrderBy(x => x.Id) { perms.Add(new SnPermission { Name = permType.Name }); } return(new SnAccessControlEntry { Identity = SnIdentity.Create(principalId), Permissions = perms, Propagates = propagates }); }