Custom Fields
Re-Envisioned
Support MB Frontend Submission You are not allowed to edit this post.

  • Creator
    Topic
  • #18315
    Resolved netalys
    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #18316
    Anh 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
    netalys
    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
    boethius
    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
    boethius
    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 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?

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
grid gear info copy caret-up caret-down trash