Support Forum
Support › MB Frontend Submission › You are not allowed to edit this post.Resolved
Hello !
I'm displaying a form to let users edit a custom post type.
The users have the role "Suscriber". In this custom post type I created a specific field linked to WordPress users to specify who was able to see the form.
It was working fine but I think since last update now these suscribers users see : "You are not allowed to edit this post."
Is there a way to let them edit the post anyway ?
Thanks.
Hi,
We added the check for permission in the latest version of MB Frontend Submission. Users can edit posts only if:
edit_posts
or edit_other_posts
)If you allows a user to edit others' posts, they must have edit_other_posts
privilege, which is available for Editor role.
OK thanks for your quick answer Anh, I added the permission with Members plugin.
Maybe it would be great to add an option in the shortcode to specify who can access the form.
Cheers !
Hi, it seems this isn't so straightforward. I added the edit_other_posts
but this actually doesn't exist. WP documents edit_others_posts
.
Either way, both privilege types don't work. The users are still not allowed to edit the post. Must the privileges be flushed somehow?
Thanks
These are the permissions that the user group has:
add_role( 'analyst', __('Analyst' ),
array(
'read' => true, // true allows this capability
'edit_posts' => true, // Allows user to edit their own posts
'edit_pages' => false, // Allows user to edit pages
'edit_other_posts' => true,
'edit_others_posts' => true, // Allows user to edit others posts not just their own
'create_posts' => false, // Allows user to create new posts
'manage_categories' => false, // Allows user to manage post categories
'publish_posts' => true, // Allows the user to publish, otherwise posts stays in draft mode
'edit_themes' => false, // false denies this capability. User can’t edit your theme
'install_plugins' => false, // User cant add new plugins
'update_plugin' => false, // User can’t update any plugins
'update_core' => false,
'upload_files' => true // user cant perform core updates
)
);
Hi boethius, you're right about the capability name. It should be edit_others_posts
.
The plugin checks if user can edit the current post with this code:
current_user_can( 'edit_post', $post->ID )
Can you please try a plugin like Members/User Roles Editor to make sure that roles can edit posts?
I am running into this issue as well. But my users are never logged in, they are always a guest but they need to be able to edit their data at a later time. My scenario is that they fill out a form to be accepted into a conference. If they are accepted, we send them a link to the second form that asks a few more questions. The system works well for me, as I am the admin, but for anyone else, they get the error on the second form stating they are not allowed to edit the post. We are not going to have the people register in WordPress, all they are doing is filling out 2 forms that are both attached to the same post_id. There used to be a way to pass access='guest' on the shortcode to allow anyone to edit, did you remove that ability?
Thanks,
Jim
I was able to solve my issue by creating an options page, then creating the field group and associating it with the options page instead of the CPT. But then it required backend code to stuff the information into the correct CPT when the form was saved. A little laboreus but it worked.