-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reusable blocks security #3936
Comments
Thanks @TKES. Just pasting some background information on this here for easy reference:
|
I'm inclined to mirror permissions pretty closely to permissions to how each role can act on normal posts.
|
It should be fairly straightforward to use the capabilities that we get from registering a custom post type to accomplish this. I've started down this path in #4031 by specifying a Lines 396 to 406 in 7be6489
|
I agree with @pento. One thing we don't have exposed is who the author of a reusable block is. I'd be wary of adding too much UI into them and treat them more like menus, where you don't have to know they are fully fledged posts. cc @jasmussen as it touches on the delete UI a bit. The more we can do from the inserter, the better, in my opinion. |
If we are to have more UI for seeing reusable block authors, and a spot to delete them, and it should be in the inserter, my best idea is that we add a "Edit" button to this screen: Perhaps needs a better label than "Edit", but the button could sit next to the "Saved Blocks" headline, and once clicked it could, for example, make the entire UI for saved blocks into a list that showed author and delete buttons. Or, hey, we could just skip that edit check and show all reusable blocks in list form, which would free up some room for UI: |
It might be good to include the type of the original block as well. Maybe it's time to swap the mosaic icon for the original icon of the block that originated the reusable one? |
#riskylife 🙂 |
I really like the idea of including an Edit button in the inserter, but I think that it should just link to a full page screen where you can administer your reusable blocks.
I agree, it's time 🕟 |
Agreed with the above: the icon should represent the type of block. Otherwise, what is the point of having an icon here, its not usable info. I think we are increasingly encountering hierarchy issues in terms of lexicon throughout the project when we address what is happening to this block instance vs this block type. And what is happening to this block vs this block content. For this reason, "edit" as a concept, is too generic. What are we editing? What are we deleting?A user will have a diff impression of edit vs an admin or a dev. I can easily see someone clicking "edit" and thinking they're editing THAT instance rather than that block or vice versa. For this reason, I think we need a completely separate screen for the administration of blocks, generally (because that opens up so many options for plugins) and it keeps the inserter from becoming a trojan horse.
|
As already mentioned in a comment in #3378, reusable blocks should have a security concept.
Currently there is none, any user can edit any existing reusable block, even users with contributor role while creating/editing a "pending review" post.
This leads to the weird situation, that a contributor is (as expected) not allowed to publish an own post, but is (unexpected) able to "live edit" sitewide content by editing existing reusable blocks.
WP 4.9.1, Gutenberg 1.9.0
The text was updated successfully, but these errors were encountered: