RemoveEntriesForPage() public static method

Removes all the ACL Entries for a page that are bound to a user group.
public static RemoveEntriesForPage ( UserGroup group, PageInfo page ) : bool
group UserGroup The user group.
page PageInfo The page.
return bool
Esempio n. 1
0
        /// <summary>
        /// Removes all the permissions for a page.
        /// </summary>
        /// <param name="pageFullName">The page full name.</param>
        private void RemoveAllPermissions(string pageFullName)
        {
            AuthWriter authWriter = new AuthWriter(Collectors.CollectorsBox.GetSettingsProvider(currentWiki));

            authWriter.RemoveEntriesForPage(Users.FindUserGroup(currentWiki, Settings.GetAnonymousGroup(currentWiki)), pageFullName);
            authWriter.RemoveEntriesForPage(Users.FindUserGroup(currentWiki, Settings.GetUsersGroup(currentWiki)), pageFullName);
            authWriter.RemoveEntriesForPage(Users.FindUserGroup(currentWiki, Settings.GetAdministratorsGroup(currentWiki)), pageFullName);
        }
Esempio n. 2
0
        /// <summary>
        /// Removes all the ACL entries for a subject.
        /// </summary>
        /// <param name="subject">The subject.</param>
        /// <param name="page">The page.</param>
        /// <returns><c>true</c> if the operation succeeded, <c>false</c> otherwise.</returns>
        private bool RemoveAllAclEntriesForPage(string subject, string page)
        {
            bool isGroup = lstSubjects.SelectedValue.StartsWith("G.");

            subject = subject.Substring(2);

            AuthWriter authWriter = new AuthWriter(Collectors.CollectorsBox.GetSettingsProvider(currentWiki));

            if (isGroup)
            {
                return(authWriter.RemoveEntriesForPage(
                           Users.FindUserGroup(currentWiki, subject), page));
            }
            else
            {
                return(authWriter.RemoveEntriesForPage(
                           Users.FindUser(currentWiki, subject), page));
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Removes all the ACL entries for a subject.
        /// </summary>
        /// <param name="subject">The subject.</param>
        /// <param name="page">The page.</param>
        /// <returns><c>true</c> if the operation succeeded, <c>false</c> otherwise.</returns>
        private bool RemoveAllAclEntriesForPage(string subject, string page)
        {
            bool isGroup = lstSubjects.SelectedValue.StartsWith("G.");

            subject = subject.Substring(2);

            PageInfo currentPage = Pages.FindPage(page);

            if (isGroup)
            {
                return(AuthWriter.RemoveEntriesForPage(
                           Users.FindUserGroup(subject), currentPage));
            }
            return(AuthWriter.RemoveEntriesForPage(
                       Users.FindUser(subject), currentPage));
        }
Esempio n. 4
0
 /// <summary>
 /// Removes all the permissions for a page.
 /// </summary>
 /// <param name="page">The page.</param>
 private void RemoveAllPermissions(PageInfo page)
 {
     AuthWriter.RemoveEntriesForPage(Users.FindUserGroup(Settings.AnonymousGroup), page);
     AuthWriter.RemoveEntriesForPage(Users.FindUserGroup(Settings.UsersGroup), page);
     AuthWriter.RemoveEntriesForPage(Users.FindUserGroup(Settings.AdministratorsGroup), page);
 }