Support » Plugin: Nested Pages » Multisite and Missing Permissions

  • Resolved Lucas Stark

    (@lucasstark)


    If you use WordPress multisite, and you are a Network Administrator the plugin does not properly check permissions to show you the “Menu Options” button from the “Quick Edit”

    To Reproduce:
    Install plugin and network activate on a WordPress multisite.

    Login as a Network Administrator

    Go to a site to test – make sure on the specific site you are not explicitly added as an Administrator.

    Go to the Pages dashboard, click on Quick Edit on any of the pages.

    You’ll notice that the Menu Options button is not available. To resolve this you have to add yourself as an Administrator to each individual site. A Network Administrator shouldn’t have to add themselves to any particular subsite, since Network Administrator is supposed to supersede any other capabilities.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Lucas Stark

    (@lucasstark)

    I found this is because the Menu Options section is not shown when the user can not sort pages.

    The way that page sorting is checked, checks the users roles as provided from $current_user->roles;

    $current_user->roles; will not contain any roles for a Network Administrator unless they are explicitly added to a site.

    It would be better to check for capabilities rather than a direct loop / comparison in the canSortPages function.

    Something like this would work better ( at least in this particular situation )

    `

    /**
    * Can current user sort pages
    * @return boolean
    * @since 1.1.7
    */
    public function canSortPages()
    {
    if (is_super_admin()){
    return true;
    }

    $roles = $this->getRoles();
    $cansort = get_option(‘nestedpages_allowsorting’, array());
    if ( $cansort == “” ) $cansort = array();

    foreach($roles as $role){
    if ( $role == ‘administrator’ ) return true;
    if ( in_array($role, $cansort) ) return true;
    }
    return false;
    }
    `

    Plugin Author Kyle Phillips

    (@kylephillips)

    This should be resolved in the latest release, 1.6.8

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multisite and Missing Permissions’ is closed to new replies.