Skip to content
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

Closed
getdave opened this issue Nov 21, 2019 · 7 comments · Fixed by #18669
Assignees
Labels
[Block] Navigation Affects the Navigation Block [Type] Task Issues or PRs that have been broken down into an individual action to take

Comments

@getdave
Copy link
Contributor

getdave commented Nov 21, 2019

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" with getEntityRecords (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 of apiFetch 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

  1. Create a User with Contributor Role.
  2. Create some Pages (not Posts!).
  3. Create a new Post and add the Nav Block.
  4. See the 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

Screen Capture on 2019-11-21 at 09-59-52

Additional Context

See also:

@getdave getdave added [Type] Bug An existing feature does not function as intended [Block] Navigation Affects the Navigation Block labels Nov 21, 2019
@getdave getdave self-assigned this Nov 21, 2019
@getdave getdave added this to 🗂 To do in Navigation editor via automation Nov 21, 2019
@getdave getdave moved this from 🗂 To do to ✋ Blocking in Navigation editor Nov 21, 2019
@getdave getdave changed the title Nav Block: broken for contributor role due to getEntityRecords records Nav Block: not fully functional for contributor role due to getEntityRecords records issue Nov 21, 2019
@getdave
Copy link
Contributor Author

getdave commented Nov 21, 2019

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.

@getdave getdave moved this from ✋ Blocking to 💻 Issues in progress in Navigation editor Nov 21, 2019
@getdave getdave removed the [Type] Bug An existing feature does not function as intended label Nov 21, 2019
@getdave
Copy link
Contributor Author

getdave commented Nov 28, 2019

@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?

@youknowriad
Copy link
Contributor

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?

@getdave
Copy link
Contributor Author

getdave commented Jan 2, 2020

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.

@mtias mtias changed the title Nav Block: not fully functional for contributor role due to getEntityRecords records issue Navigation Block: not fully functional for contributor role due to getEntityRecords records issue Mar 10, 2020
@mtias
Copy link
Member

mtias commented Mar 10, 2020

@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 mtias added the [Type] Task Issues or PRs that have been broken down into an individual action to take label Mar 10, 2020
Navigation editor automation moved this from Issues in progress to Done Apr 1, 2020
@getdave
Copy link
Contributor Author

getdave commented Apr 20, 2020

@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.

@mtias
Copy link
Member

mtias commented Apr 29, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Type] Task Issues or PRs that have been broken down into an individual action to take
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants