RemoveEntriesForNamespace() public static method

Removes all the ACL Entries for a namespace that are bound to a user group.
public static RemoveEntriesForNamespace ( UserGroup group, NamespaceInfo nspace ) : bool
group UserGroup The user group.
nspace NamespaceInfo The namespace (null for the root).
return bool
Ejemplo n.º 1
0
        /// <summary>
        /// Removes all the permissions for a namespace.
        /// </summary>
        /// <param name="nspace">The namespace (<c>null</c> for the root).</param>
        private void RemoveAllPermissions(NamespaceInfo nspace)
        {
            string currentWiki = DetectWiki();

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

            authWriter.RemoveEntriesForNamespace(Users.FindUserGroup(currentWiki, Settings.GetAnonymousGroup(currentWiki)), nspace);
            authWriter.RemoveEntriesForNamespace(Users.FindUserGroup(currentWiki, Settings.GetUsersGroup(currentWiki)), nspace);
            authWriter.RemoveEntriesForNamespace(Users.FindUserGroup(currentWiki, Settings.GetAdministratorsGroup(currentWiki)), nspace);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Removes all the ACL entries for a subject.
        /// </summary>
        /// <param name="subject">The subject.</param>
        /// <param name="nspace">The namespace (<c>null</c> for the root).</param>
        /// <returns><c>true</c> if the operation succeeded, <c>false</c> otherwise.</returns>
        private bool RemoveAllAclEntriesForNamespace(string subject, string nspace)
        {
            bool isGroup = lstSubjects.SelectedValue.StartsWith("G.");

            subject = subject.Substring(2);

            NamespaceInfo namespaceInfo = Pages.FindNamespace(currentWiki, nspace);

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

            if (isGroup)
            {
                return(authWriter.RemoveEntriesForNamespace(
                           Users.FindUserGroup(currentWiki, subject), namespaceInfo));
            }
            else
            {
                return(authWriter.RemoveEntriesForNamespace(
                           Users.FindUser(currentWiki, subject), namespaceInfo));
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Removes all the ACL entries for a subject.
        /// </summary>
        /// <param name="subject">The subject.</param>
        /// <param name="nspace">The namespace (<c>null</c> for the root).</param>
        /// <returns><c>true</c> if the operation succeeded, <c>false</c> otherwise.</returns>
        private bool RemoveAllAclEntriesForNamespace(string subject, string nspace)
        {
            bool isGroup = lstSubjects.SelectedValue.StartsWith("G.");

            subject = subject.Substring(2);

            NamespaceInfo namespaceInfo = Pages.FindNamespace(nspace);

            if (isGroup)
            {
                return(AuthWriter.RemoveEntriesForNamespace(
                           Users.FindUserGroup(subject), namespaceInfo));
            }
            return(AuthWriter.RemoveEntriesForNamespace(
                       Users.FindUser(subject), namespaceInfo));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Removes all the permissions for a namespace.
 /// </summary>
 /// <param name="nspace">The namespace (<c>null</c> for the root).</param>
 private void RemoveAllPermissions(NamespaceInfo nspace)
 {
     AuthWriter.RemoveEntriesForNamespace(Users.FindUserGroup(Settings.AnonymousGroup), nspace);
     AuthWriter.RemoveEntriesForNamespace(Users.FindUserGroup(Settings.UsersGroup), nspace);
     AuthWriter.RemoveEntriesForNamespace(Users.FindUserGroup(Settings.AdministratorsGroup), nspace);
 }