-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Navigation Block: not fully functional for contributor role due to getEntityRecords
records issue
#18659
Comments
getEntityRecords
recordsgetEntityRecords
records issue
After investigating I'm not sure I see this as a Blocker. The Block UI handles the lack of Page data gracefully and the Block is still usable even if you can't auto create from Pages. As Contributors can't access Pages anyway it could be argued that this should be the correct state. This is progressive enhancement in action. |
@youknowriad I'm not 100% as to whether this is still considered a "bug" or whether it is an intended feature of the permissions system? |
I personally think it's probably still a bug, because a contributor has access to these pages "view" so it should be possiible to use them to create menu items. We're not editing these pages here right? |
Not as I understand it. Text labels for menu items shouldn't be related to the underlying entities. That said I am aware that folks wanted to be able to create Pages from the Nav Block interface. |
getEntityRecords
records issuegetEntityRecords
records issue
@youknowriad I think we should actually disable this block for contributors and authors since there is not clear use of it in those contexts. |
@mtias is this still your opinion? Because this Issue may need reopening soon and it could be a lot simpler to disable the block from being registered based on user role. |
Yes, I think so. There might still be contexts in which it's desirable that this blocks renders properly, even if it's not editable by the current user. |
When using the Nav Block as a user with the
Contributor
Role to the "Create from Pages" option in the placeholder will never work. This is because of a potential "bug" withgetEntityRecords
(which is infact potentially a bug with the REST API - @youknowriad may be able to shed additional light on this).As it stands Blocks need to avoid
getEntityRecords
in favour ofapiFetch
directly until this bug is resolved.In order that Nav Block can land we need to swap out the usage of this selector for
apiFetch()
directly.To reproduce
Contributor
Role.Create from all Top Pages
button is always disabled.Expected behavior
The Block placeholder should load and show the option to create from Pages for all Roles.
Screenshots
Additional Context
See also:
The text was updated successfully, but these errors were encountered: