Hi,
I may be missing something - but I'm using the Views beta with block-based layouts, and I can't work out how to hide the Toolset blocks from editor-level logins.
To clarify: I want to be able to allow editors to create and manage custom post types I've defined, and add previously-defined field groups and repeatable fields, etc.to those posts - but I don't want them to be able to see and use all the Toolset blocks in the Gutenberg UI. They don't need them, and they'll break everything.
Any pointers?
Thanks!
James
Hi, let me ask my developers if there is a public API for managing who sees the Toolset blocks in the block editor. I'm not aware of one but I'll let you know what I find out.
Thanks, Christian - that would be great.
Hi, our developers got back to me and let me know there is no public API for managing individual blocks in the block editor interface. They mentioned some uncertainty about how this could work. Let's say you want to disable the "conditional" block for Editors. What happens if an admin User creates a post and uses the conditional block in the post contents, then the Editor needs to make a minor text change? If the conditional block is completely disabled for Editors, when the Editor saves the update, it would also delete the existing conditional block(s).
Or maybe you were suggesting that an existing conditional block would appear in the post content / builder, but would not be available in the Block menu so Editors could not insert new conditional blocks? At any rate, feel free to add a request for a new feature in our form here: https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Please elaborate on how it would work considering the scenario I described, and add any more details you can think of.
Thanks for getting back to me, Christian.
"Or maybe you were suggesting that an existing conditional block would appear in the post content / builder, but would not be available in the Block menu so Editors could not insert new conditional blocks?"
That's precisely it - I just don't want Editors browsing for and adding new Toolset blocks (we give our clients Editor user accounts, or Editor with user promote). I'm a bit concerned that - while I can mostly avoid this by building with Views in the 2.9 channel (and the only thing the Editor will be able to do is add predefined Views) - as everything moves to 3.0 with a focus on Gutenberg, all these new Toolset Blocks are going to appear for them.
I see what you mean. I think a feature request is the best way to proceed here. Provide these details in your submission so our developers can evaluate your idea and determine if it's something we should add to the software. In the meantime, a custom CSS or JavaScript approach might be more feasible. A skilled developer could create a stylesheet or custom JavaScript file for the admin area that is only loaded for these Editor Users. Then use JavaScript and/or CSS to hide each button or button group.
https://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts
Feature request submitted. Noted re: hiding things with CSS.
Thanks for your support, Christian.
Thanks for you input. I heard about the feature request from a colleague earlier today and I'm optimistic that we will have Access control for Toolset Blocks in an upcoming release.
Yes, Amit said he was adding to your roadmap - fantastic. Thanks again, Christian. 🙂