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.

Permissions issues (dashboard widgets remain)

  1. Wordpress Version: 3.4.1
    Gravity forms Version: 1.6.4.5.4

    I use the members plugin by Justin Tadlock to deal with permissions. I remove all gravity form permissions from editors down (only admins can deal with forms at all) However this seems to have stopped working.

    When I first install gravity forms and members on a site the admin does not have any gravity forms permissions by default, I assume this is not the intended default. Editors do you have permissions and if I remove them there is no effect, they can still access everything Gravity Forms wise.

    Any ideas?

    Posted 11 years ago on Thursday July 19, 2012 | Permalink
  2. David Peralty

    You have them log out and then back in to double check right? Are you running any caching software? I am not too experienced with Justin's members plugin.

    Posted 11 years ago on Thursday July 19, 2012 | Permalink
  3. Yeah have logged in an out multiple times. No Cache plugins.

    Posted 11 years ago on Friday July 20, 2012 | Permalink
  4. When you say "However this seems to have stopped working." - what do you mean? It used to work, there were no changes, and then it stopped working all of the sudden? When did it stop working? Is it related to an update in WordPress or Gravity Forms, or did you change hosts or URL or themes? Anything else relevant you can share with us?

    Posted 11 years ago on Friday July 20, 2012 | Permalink
  5. Hi. This issue occurs when activating my base theme which I use as a framework for sites. Before this, using the same plugins the issue does not occur. I believe it is likely to do with my functions-setup.php. This file runs once when first activating the theme. There is a section that deals with user permissions. I don't quite see how this would be effecting form permissions but it seems the most likely candidate.

    Thanks

    /*////////////////////////////////////////////////////////////
    If needed to run functions again chnage uncommend below
    ////////////////////////////////////////////////////////////*/
    //update_option( 'theme_setup_status', '0' );
    
    /*////////////////////////////////////////////////////////////
    Run on first theme switch
    ////////////////////////////////////////////////////////////*/
    add_action( 'after_setup_theme', 'the_theme_setup' );
    
    function the_theme_setup()
    {
    	// First we check to see if our default theme settings have been applied.
    	$the_theme_status = get_option( 'theme_setup_status' );
    	// If the theme has not yet been used we want to run our default settings.
    	if ( $the_theme_status !== '1' ) {
    /*////////////////////////////////////////////////////////////
    Setup Default WordPress settings
    ////////////////////////////////////////////////////////////*/
    		$core_settings = array(
    			'avatar_default'				=> 'mystery',					// Comment Avatars should be using mystery by default
    			'avatar_rating'					=> 'G',							// Avatar rating
    			'comment_max_links'				=> 0,							// We do not allow links from comments
    			'comments_per_page'				=> 20							// Default to 20 comments per page
    		);
    		foreach ( $core_settings as $k => $v ) {
    			update_option( $k, $v );
    		}
    /*////////////////////////////////////////////////////////////
    Delete dummy post, page and comment.
    ////////////////////////////////////////////////////////////*/
    		wp_delete_post( 1, true );
    		wp_delete_post( 2, true );
    		wp_delete_comment( 1 );
    
    /*////////////////////////////////////////////////////////////
    Add pages
    ////////////////////////////////////////////////////////////*/
    	$new_page_title = array ('Home','Contact','About');
    	$new_page_content = array ('');
    	$new_page_template = array (''); //Template, blank for default
    
    	foreach ( $new_page_title as $page_title ) {
    
    		$page_check = get_page_by_title($page_title);
    		$new_page = array(
    			'post_type' => 'page',
    			'post_title' => $page_title,
    			'post_content' => $new_page_content,
    			'post_status' => 'publish',
    			'post_author' => 1,
    		);
    		if(!isset($page_check->ID)){
    			$new_page_id = wp_insert_post($new_page);
    			if(!empty($new_page_template)){
    				update_post_meta($new_page_id, '_wp_page_template', $new_page_template);
    			}
    		}
    
    	}//end foreach
    /*////////////////////////////////////////////////////////////
    set page as front page
    ////////////////////////////////////////////////////////////*/
    	$homeSet = get_page_by_title( 'Home' );
    	update_option( 'page_on_front', $homeSet->ID );
    	update_option( 'show_on_front', 'page' );
    
    /*////////////////////////////////////////////////////////////
    Change permalink structure
    ////////////////////////////////////////////////////////////*/
    global $wp_rewrite;
        $wp_rewrite->set_permalink_structure( '/%postname%/' );
    
    /*////////////////////////////////////////////////////////////
    Remove wordpress roles
    ////////////////////////////////////////////////////////////*/
    remove_role( 'author' );
    remove_role( 'contributor' );
    
    /*////////////////////////////////////////////////////////////
    Set role capabilities
    ////////////////////////////////////////////////////////////*/
    $edit_editor = get_role('editor');
    
    $edit_editor->add_cap('add_users');
    $edit_editor->add_cap('create_users');
    $edit_editor->add_cap('delete_users');
    $edit_editor->add_cap('edit_users');
    $edit_editor->add_cap('list_users');
    $edit_editor->add_cap('promote_users');
    $edit_editor->add_cap('remove_users');
    
    $edit_editor->add_cap('edit_theme_options');
    
    $edit_editor->remove_cap('manage_links');
    
    /*////////////////////////////////////////////////////////////
    Set theme_setup_status as 1
    ////////////////////////////////////////////////////////////*/
    		update_option( 'theme_setup_status', '1' );
    		$msg = '
    		<div class="error">
    			<p>The ' . get_option( 'current_theme' ) . 'theme has changed your WordPress default <a href="' . admin_url() . 'options-general.php" title="See Settings">settings</a> and deleted default posts & comments.</p>
    		</div>';
    		add_action( 'admin_notices', $c = create_function( '', 'echo "' . addcslashes( $msg, '"' ) . '";' ) );
    
    	}
    	elseif ( $the_theme_status === '1' and isset( $_GET['activated'] ) ) {
    		$msg = '
    		<div class="updated">
    			<p>The ' . get_option( 'current_theme' ) . ' theme was successfully re-activated.</p>
    		</div>';
    		add_action( 'admin_notices', $c = create_function( '', 'echo "' . addcslashes( $msg, '"' ) . '";' ) );
    	}
    }
    Posted 11 years ago on Tuesday September 11, 2012 | Permalink
  6. If you disable the custom functions here which affect the roles and permissions, does everything work properly? Sounds like your custom code is conflict with the Gravity Forms roles and permissions and the Member plugin from Justin Tadlock.

    Maybe you can add some code to your custom functions to ensure that the Members plugin code runs afterward, if that's what needs to happen.

    This custom code is not related to Gravity Forms and beyond the support we can provide in these forums.

    Posted 11 years ago on Wednesday September 12, 2012 | Permalink
  7. I have managed to hone this down a fair bit for anyone else experiencing a similar issue. The permission causing this issue is delete_users. If I add the delete_users permission to the editor role then the editor is able to create forms. If I remove the permission editors lose the ability to create forms.

    Posted 11 years ago on Wednesday September 12, 2012 | Permalink
  8. Thank you for that update.

    Posted 11 years ago on Friday September 14, 2012 | Permalink

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