public override ACL GetACL(Type type) { ACL acl = base.GetACL(type); acl.Add(new ACLEveryoneAllowRetrieve()); acl.Add(new ACLAccount(mInstance.AccountBlog.Account, DataOperation.All)); if (ManagedDiscussion.IsDiscussionType(type)) { if (mInstance.EnableComments && mInstance.AccountBlog.EnableComments) { acl.Add(new ACLAuthenticatedAllowCreate()); } } foreach (AccountBlogAuthor author in Collection <AccountBlogAuthor> .GetSafeCollection(mInstance.AccountBlog.AccountBlogAuthors)) { int op = (int)DataOperation.None; if (author.AllowDelete) { op |= (int)DataOperation.Delete; } if (author.AllowEdit) { op |= (int)DataOperation.Update; } if (author.AllowPost) { op |= (int)DataOperation.Create; } acl.Add(new ACLAccount(author.Account, op)); } return(acl); }
public override ACL GetACL(Type type) { if (ManagedDiscussion.IsDiscussionType(type)) { ACL acl = base.GetACL(type); // members can post articles, admins can edit and delete foreach (AccountGroupAccount account in Collection <AccountGroupAccount> .GetSafeCollection(mInstance.AccountGroupAccounts)) { acl.Add(new ACLAccount(account.Account, account.IsAdministrator ? DataOperation.All : DataOperation.Create | DataOperation.Retreive)); } return(acl); } else { ACL acl = base.GetACL(type); // everyone can create a group acl.Add(new ACLAuthenticatedAllowCreate()); // everyone is able to see a group (only name/description) acl.Add(new ACLEveryoneAllowRetrieve()); // members can edit or see the group depending on their permissions foreach (AccountGroupAccount account in Collection <AccountGroupAccount> .GetSafeCollection(mInstance.AccountGroupAccounts)) { acl.Add(new ACLAccount(account.Account, account.IsAdministrator ? DataOperation.All : DataOperation.Retreive)); } return(acl); } }
public override ACL GetACL(Type type) { ACL acl = base.GetACL(type); acl.Add(new ACLEveryoneAllowRetrieve()); acl.Add(new ACLAccount(mInstance.AccountFeed.Account, DataOperation.All)); if (ManagedDiscussion.IsDiscussionType(type)) { acl.Add(new ACLAuthenticatedAllowCreate()); } return(acl); }