PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Role permission to prevent user from viewing GF help

  1. dixhuit
    Member

    Hi folks.

    I use the Members plugin to manage roles/permissions for users. GF already hooks into this pretty nicely but I'd like to be able to stop some users from seeing 'Help' under the main 'Forms' admin menu item. I find the GF Help useful, but to a user that only needs to read/edit entries (not embed forms or learn about hooks) it's just confusing code (and we all know how much certain users hate seeing code).

    Does anybody know of a way to do this or can we have it added in a future release?

    Cheers.

    Posted 9 years ago on Tuesday April 20, 2010 | Permalink
  2. We will look into adding this in one of the next releases as a capability that can be controlled via the Members plugin.

    Posted 9 years ago on Tuesday April 20, 2010 | Permalink
  3. dixhuit
    Member

    Splendid.

    [does celebratory dance]

    Posted 9 years ago on Wednesday April 21, 2010 | Permalink
  4. Alex Smith
    Member

    @Carl - Was this capability ever added?

    Posted 8 years ago on Sunday June 12, 2011 | Permalink
  5. Wow, was just searching for the same thing! Search by Tags for-the-win!

    The in-depth help/faq section is a little much for the non technical client. If you host a client on multisite, you can tuck it in to the if(current_user_can("install_plugins") on line 451 of gravityforms.php.

    Instead of this:

    //if(!function_exists("is_multisite") || !is_multisite() || is_super_admin())
            if(current_user_can("install_plugins")){
                add_submenu_page($parent_menu["name"], __("Updates", "gravityforms"), __("Updates", "gravityforms"), $has_full_access ? "gform_full_access" : "gravityforms_view_updates", "gf_update", array("RGForms", "update_page"));
                add_submenu_page($parent_menu["name"], __("Add-Ons", "gravityforms"), __("Add-Ons", "gravityforms"), $has_full_access ? "gform_full_access" : "gravityforms_view_addons", "gf_addons", array("RGForms", "addons_page"));
            }
    
            add_submenu_page($parent_menu["name"], __("Help", "gravityforms"), __("Help", "gravityforms"), $has_full_access ? "gform_full_access" : $min_cap, "gf_help", array("RGForms", "help_page"));
    
        }

    You'd do this:

    //if(!function_exists("is_multisite") || !is_multisite() || is_super_admin())
            if(current_user_can("install_plugins")){
                add_submenu_page($parent_menu["name"], __("Updates", "gravityforms"), __("Updates", "gravityforms"), $has_full_access ? "gform_full_access" : "gravityforms_view_updates", "gf_update", array("RGForms", "update_page"));
                add_submenu_page($parent_menu["name"], __("Add-Ons", "gravityforms"), __("Add-Ons", "gravityforms"), $has_full_access ? "gform_full_access" : "gravityforms_view_addons", "gf_addons", array("RGForms", "addons_page"));
            add_submenu_page($parent_menu["name"], __("Help", "gravityforms"), __("Help", "gravityforms"), $has_full_access ? "gform_full_access" : $min_cap, "gf_help", array("RGForms", "help_page"));
            }

    That said, I don't advocate changing core code. I think Carl's hand would come out of the monitor and slap us across the face if we did.

    I'll think of a better way...

    Posted 8 years ago on Tuesday June 28, 2011 | Permalink
  6. @eyecool It probably does make sense to make the Help page only available for Super Admins when running in Multi-Site mode which is what we do for the Updates and Add-On pages, which require the ability to be able to update and install plugins which is why it's restricted to Super Admins only. Since the Help page is basically organized links to the Documentation on the support site, which requires a customer login to access, it is probably useless for anyone but the Super Admin who is going to have access to the support site. We will go ahead and make this change in the next release.

    Posted 8 years ago on Tuesday June 28, 2011 | Permalink
  7. A better way, without touching core files, is to disable it on a per-site basis using the theme's function.php

    add_action( 'admin_menu', 'eyecool_remove_menus', 999 );
    
    function eyecool_remove_menus() {
    
    	remove_submenu_page( 'gf_edit_forms', 'gf_help' );
    
    }

    This removes it for everyone. And if you change themes, remember to add the function to your new theme.

    Posted 8 years ago on Tuesday June 28, 2011 | Permalink
  8. Hi Carl, thanks for your reply! Sounds good to me.

    You've got a great link called: http://gravityhelp.com/documentation/page/How_To which includes a snippet for adding your own Sub-Page: http://pastie.org/1682994

    Very handy for dropping in a custom "Gravity Forms 101" page suited for the non-night owl, 9-5, "I believe in the cloud" non tech types.

    Posted 8 years ago on Tuesday June 28, 2011 | Permalink
  9. Alex Smith
    Member

    @eyecool

    "A better way, without touching core files, is to disable it on a per-site basis using the theme's function.php"

    Your code snippet works like a charm - much appreciated!!

    Posted 8 years ago on Tuesday June 28, 2011 | Permalink
  10. Fluid,

    You're welcome!

    Posted 8 years ago on Saturday July 2, 2011 | Permalink
  11. UWEX
    Member

    eyecool's code is exactly what I arrived at myself, however it's not working for me.

    I agree that this should have its own capability, but regardless, I'm fine with removing via plugin. The problem is the plugin isn't removing it for me ... gravity forms 1.6.2

    Anything change that would make this snippet not work anymore?

    EDIT: resolved.
    Since I also remove the ability to generate new forms, the slug for me was different (I had to use gf_entries)

    Is there a way to remove the Help submenu regardless of what other capabilities I've removed from users on various sites? ...I provide my own help ;)

    Thanks!

    Posted 7 years ago on Tuesday December 6, 2011 | Permalink
  12. I'm using a plugin called Menu Editor Pro to stop users from viewing certain areas of Gravity Forms. Works well except I'd like to stop the user from viewing the Toolbar Links regarding Form Editor, Form Settings, etc when viewing just entries.

    Posted 6 years ago on Sunday November 4, 2012 | Permalink
  13. Does the plugin allow you to edit the admin bar, or just menu items?

    Posted 6 years ago on Monday November 5, 2012 | Permalink
  14. Hi Chris,

    It just lets you edit or hide the left-side menu items for certain users or roles.

    Posted 6 years ago on Thursday November 8, 2012 | Permalink
  15. Adding this to your theme's functions.php will hide the Forms drop down in admin bar:

    [php]
    function gform_remove_admin_menu() {
        global $wp_admin_bar;
        $wp_admin_bar->remove_menu('toplevel_page_gf_edit_forms');
    }
    add_action( 'wp_before_admin_bar_render', 'gform_remove_admin_menu' );
    Posted 6 years ago on Thursday November 8, 2012 | Permalink
  16. Great, thanks for the info!

    Posted 6 years ago on Monday November 19, 2012 | Permalink
  17. You're welcome.

    Posted 6 years ago on Monday November 19, 2012 | Permalink

This topic has been resolved and has been closed to new replies.