Create Users Who Can Only See Gravity Forms Entries

We have a PublishPress customer who also uses the Gravity Forms plugin. They asked us if it was possible to create a user who can do nothing in WordPress, except for edit form entries in Gravity Forms.

Yes, this is possible, and this tutorial will show you how.

You will need the PublishPress Capabilities plugin installed. We will create new user role called “Gravity Forms” and give them access to Gravity Forms entries. There's a more advanced version of this tutorial available for sites also using WooCommerce.


Step #1. Create a New User Role

First, we're going to copy the Subscriber role because it has very limited permissions. Click here for more on creating new user roles.

  • Go to the “Capabilities” link in your WordPress admin menu.
  • Choose “Subscriber” in the dropdown in the top-left corner.
  • Enter “Gravity Forms” into the “Copy Subscriber Role” box.
  • Click “Copy”.
Gravity Forms 1
Gravity Forms 1

Step #2. Add the Gravity Forms Permission

We're now going to add a new permission to give this role access to Gravity Forms entries.

  • Find the “Add Capability” box.
  • Type “gravityforms_view_entries”.
  • Click “Add to role”.
Gravity Forms new capability
2 1
  • Scroll down and make sure the box is checked for this permission:
Gravity Forms capabilities
3

Step #3. Create and Test the User

Our final step is to create a user for our new role:

  • Go to the “Users” area in your WordPress admin menu.
  • Create a new user in the “Gravity Forms” role.
Gravity Forms entries
4

Now it's time to test your new user. You can either login as the new user in different browser, or reply on a plugin such as User Switching.

When you login as your new user, this image shows what you will see. The user will have very limited access, but they will be able to view Gravity Forms entries:

Gravity Forms dashboard
5 1

Summary

It is possible to expand on this basic set of permissions. We used “gravityforms_view_entries” but the Gravity Forms documentation has more permissions you can give to these users.

For example, you can repeat Step #2 and add “gravityforms_export_entries”. This would allow user to export the entries. Or you could add “gravityforms_edit_entries” and that would allow them to edit the entries.

You might find other PublishPress guides useful including our introduction to bbPress roles and capabilities, plus tutorials on restricting user access in Beaver Builder and Elementor.


PublishPress works great with Gravity Forms

Join PublishPress today and you'll get powerful publishing and permissions plugins to improve your WordPress site.

7 Comments

  1. is it possible to allow a user to edit only one form, i don’t want the user to have access to all forms.
    For example User A can modify only Form 1, and User B can modify only Form 2.
    I’m no php expert, but I thought with the function.php file, I would like to authorize a specific user ($user = ‘Username’;) to access a single form (if ($form[‘id’] == ‘1’).
    function wpc_gravity_forms() {
    $role = get_role(‘editor’);
    $role->add_cap( ‘gravityforms_view_entries’ );
    $role->add_cap( ‘gravityforms_edit_entries’ );
    $role->add_cap( ‘gravityforms_delete_entries’ );
    $role->add_cap( ‘gravityforms_edit_forms’ );
    $role->add_cap( ‘gravityforms_export_entries’ );
    }
    add_action(‘admin_init’,’wpc_gravity_forms’);

    Thanks

  2. Need authors to view only their own entries, any entries that are from a different author must be hidden to Author creating their own entries.

    Does your plugin provide this granular level of access? Please inform me.

    Rob

Leave a Reply

Your email address will not be published. Required fields are marked *