You are not allowed to edit this post.
Support › MB Frontend Submission › You are not allowed to edit this post.Resolved
- This topic has 7 replies, 4 voices, and was last updated 5 months, 2 weeks ago by
Jim H.
-
AuthorPosts
-
February 17, 2020 at 8:56 PM #18315
netalys
ParticipantHello !
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.
February 17, 2020 at 9:26 PM #18316Anh Tran
KeymasterHi,
We added the check for permission in the latest version of MB Frontend Submission. Users can edit posts only if:
- They are the author of those posts, or
- They have proper privileges (
edit_posts
oredit_other_posts
)
If you allows a user to edit others' posts, they must have
edit_other_posts
privilege, which is available for Editor role.February 17, 2020 at 9:43 PM #18322netalys
ParticipantOK 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 !February 24, 2020 at 9:36 PM #18391boethius
ParticipantHi, it seems this isn't so straightforward. I added the
edit_other_posts
but this actually doesn't exist. WP documentsedit_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
February 24, 2020 at 9:50 PM #18392boethius
ParticipantThese 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 ) );
February 25, 2020 at 3:56 PM #18393Anh Tran
KeymasterHi 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?
November 4, 2024 at 1:23 AM #46818Jim H
ParticipantI 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,
JimNovember 11, 2024 at 3:43 PM #46907Jim H
ParticipantI 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.
-
AuthorPosts
- You must be logged in to reply to this topic.