• Resolved wpzoneman

    (@wpzoneman)


    I would like to prevent the user role of editor (or lower than administrators) to access to the container, row and column settings. What would it take to accomplish this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The very simple, but not safe method would be to hide the elements via CSS.

    You can write the user role in the body class as described here: https://stackoverflow.com/a/47855698/9739794

    And then hide the elements via CSS.
    For example:
    body.editor .buttontohide {display: none}

    Plugin Contributor tschortsch

    (@tschortsch)

    Hi @wpzoneman. Hmm since the whole editor is written in JavaScript and therefore rendered on the client-side it’s probably not that easy to restrict certain options for certain roles. Of course it would be possible to hide some of those options as @comonist34 wrote but security-wise this is not really safe. What should additionally be restricted is the “save” call to the API which is triggered by the editor itself but I think Gutenberg doesn’t offer a simple way to do that.
    What could be implemented are block-level permissions with which it would be possible to define which role should see which blocks but this doesn’t really help your use case.

    Thread Starter wpzoneman

    (@wpzoneman)

    @tschortsch Thank you for looking into this. Do you think the new lock settings in WordPress 6.0 will work with Bootstrap Blocks?

    Block Locking Settings in WordPress 6.0

    Plugin Contributor tschortsch

    (@tschortsch)

    The locking feature should be enabled by default for all blocks. So yes, it should be available for the Bootstrap blocks as well.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Restrict access to Bootsrap Blocks’ is closed to new replies.