You are not allowed to edit this post.

Support MB Frontend Submission You are not allowed to edit this post.Resolved

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #18315
    netalysnetalys
    Participant

    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.

    #18316
    Anh TranAnh Tran
    Keymaster

    Hi,

    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 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.

    #18322
    netalysnetalys
    Participant

    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 !

    #18391
    boethiusboethius
    Participant

    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

    #18392
    boethiusboethius
    Participant

    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
    )
    );
    #18393
    Anh TranAnh Tran
    Keymaster

    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?

    #46818
    Jim HJim H
    Participant

    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

    #46907
    Jim HJim H
    Participant

    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.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.