Change WordPress user roles and capabilities Forums Bug Reports Cannot disable gravity forms for administrators

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #430
    Brewster
    Spectator

    Hi

    I want to stop all site admins from being able to access gravity forms on my multisite installation. I have unchecked all of the gravity forms checkboxes for the administrator user, but the forms menu is still accessible to all admins.

    Please help ! 🙂

    Thanks,
    Joe

    #433
    Vladimir
    Keymaster

    Hi Joe,

    If user with ‘administrator’ role has no any GF capabilities he automatically get full access to GF plugin functionality, line #841 of gravityforms.php file:

            else if(current_user_can("administrator")|| is_super_admin()){
    
                //checking if user has any GF permission.
                $has_gf_cap = false;
                foreach($gf_caps as $gf_cap){
                    if(rgar($all_caps, $gf_cap))
                        $has_gf_cap = true;
                }
    
                if(!$has_gf_cap){
                    //give full access to administrators if none of the GF permissions are active by the Members plugin
                    $all_caps["gform_full_access"] = true;
                }
            }
    

    Try to leave at least one minimal capability, e.g. “gravityforms_view_entries” and check how the access of administrator user will be changed.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.