Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Mike Biolsi

Inline Editing not available for anyone but admins

I have created several user roles that have similar permissions to admins. I have inline editing enabled on all of my column views. IF a user has the role of Administrator they can inline edit. If they have any other user role, they can see the toggle for inline editing, but when they click it, no inline editing is available.

I am using PublishPress Permissions and Capabilities to manage roles and permissions. Is there a setting I need to change somewhere so other roles can have inline editing?

1 year, 2 months ago
Stefan van den Dungen Gronovius
Developer

Our plugin does for post list tables two check if a user can edit.
A global check current_user_can( ‘edit_posts’ ) is used to see if the user can inline edit overall.
This causes the inline edit button to show.
When this feature is enabled, on the list table for each record is determined if the user can edit the individual post with the following check
current_user_can( ‘edit_post’, $id )

I suspect that this call fails for the users on your website with no admin rights.
Can you check if this is the case?

1 year, 2 months ago
Gerson Robles

I’m seeing the same issue on my site. I have created a user role as follows:

add_role('eventtracker', 'Event Tracker', array(
'read' => true,
'create_posts' => true,
'edit_posts' => true,
'edit_others_posts' => true,
'publish_posts' => true,
));

Although the user can see the ‘Inline Edit’ toggle on the post list, they cannot actually edit the fields. Only the Administrator can. What could be the issue?

12 months ago
Stefan van den Dungen Gronovius
Developer

Do you have this issue only on the Post list page, or on the other post types as well.
As mentioned in the topic above, two checks are performed to see if a user may edit a post.

current_user_can( $this->post_type->cap->edit_posts ) (this is the global check)
current_user_can( $this->post_type->cap->edit_post, $id ) (this is check per item)

We changed this a little bit to look up the capabilities per item per post type.
I suspect, that you can also give the capability ‘edit_post’ to your role as well.

12 months ago
Gerson Robles

I’m having this issue on a CPT i created using ACF. Would you mind taking a look for me in the dev site as I’m not sure what is going wrong. How can i get the temp access to you?

12 months ago
Stefan van den Dungen Gronovius
Developer

I tried to reproduce the issue by using the ACF plugin. I create a custom post type and used your snippet to create the eventtracker role. At first, I was indeed not able to edit the post.

With the ‘Members’ plugin, I changed the capabilities of the eventtracker role to see what would cause the user to get the correct editing rights. After some testing, it seems that the capability ‘edit_published_posts’ did the trick. And after removing it, the editing permission in Inline Edit were also gone.

So it seems that the edit_post with ID capability does more than just a simple capability check. It runs trough some more capabilities to determine if a user can edit a specific post.

You should be able to do the same and give you role the edit_published_posts capability.

12 months ago

You must be logged in to reply to this topic.