• Resolved fod85

    (@fod85)


    Hi, I just noticed that the item “Edit posts from others” also affects the reusable blocks.
    My case is this: i have a multi-vendor store, the vendors can create posts. I obviously don’t want a vendor to be able to edit others’ posts, so I click deny. As a result, he can no longer convert the Reusable Blocks to Normal Blocks, which is what I need.
    How can I solve this?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Caseproof

    (@caseproof)

    Hi @fod85

    ?Sorry for a bit slow response.

    I asked our developer for checking this and he found that this is a known limitation with WordPress and the capabilities it uses for the reusable blocks. The issue was raised a few years ago, but ultimately marked as wontfix by the core team. https://core.trac.www.ads-software.com/ticket/45423
    The capabilities for reusable blocks are mapped to the capabilities for posts, which is why you’re seeing that issue. Given that core WordPress doesn’t use unique capabilities for the blocks, there’s no way for Members to change that. You could try a custom filter using register_post_type_args, and modifying the capabilities for the wp_block post type, but we haven’t tested this to confirm it will resolve the issue. Here are the wp_block capabilities (copied from core):

    'capabilities'          => array(
    	// You need to be able to edit posts, in order to read blocks in their raw form.
    	'read'                   => 'edit_posts',
    	// You need to be able to publish posts, in order to create blocks.
    	'create_posts'           => 'publish_posts',
    	'edit_posts'             => 'edit_posts',
    	'edit_published_posts'   => 'edit_published_posts',
    	'delete_published_posts' => 'delete_published_posts',
    	'edit_others_posts'      => 'edit_others_posts',
    	'delete_others_posts'    => 'delete_others_posts',
    )

    Hopefully, that helps.

    Thread Starter fod85

    (@fod85)

    Hi, thanks for the answer. Unfortunately, I am not a professional and do not know what you mean with the tip and where I can make the change. Is there a tutorial for this? Or can you tell me what I should do to try this: “You could try a custom filter using register_post_type_args, and modifying the capabilities for the wp_block post type, but we haven’t tested this to confirm it will resolve the issue. Here are the wp_block capabilities (copied from core)”

    I am not a complete beginner, but unfortunately I do not know what to do. I like to try it out because it’s pretty dumb the way it is now. Can you please help me again and tell me where to do what or tell me a tutorial or something I can google? That would be great.
    Best wishes

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘“Edit posts from others” affects reusable blocks’ is closed to new replies.