Problem/Motivation
Non admins cant see the list of feedback as the access check is using a non existing permission.
Steps to reproduce
Create a user associated with a role which has all Feedback permissions.
User can t access /admin/content/feedback_message
Proposed resolution
Add the 'view feedback message entities' to feedback.permissions.yml
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3420616-10.patch | 717 bytes | isampo |
Issue fork feedback-3420616
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
avpadernoThe permission is already present in the feedback.permissions.yml file.
Comment #3
quadbyte commentedComment #4
quadbyte commentedSorry I had wrong copy/paste in my initial post
The missing one from permissions yml : "view feedback message entities"
And it is in use in : FeedbackMessageHtmlRouteProvider
Comment #5
yanniboi commentedI can confirm this issue and I would suggest using the "administer feedback message entities" permission for the collection page.
Comment #7
yanniboi commentedI've created a PR to fix this. :)
Comment #8
yanniboi commentedComment #9
avpadernoComment #10
isampo commentedAccessing the listing using the `administer feedback message entities` permission works with the latest MR and is better already as now the collection can be accessed. Attached the change as a static patch for composer projects.
Anyhow it might need to be re-thought though as the current description for the permission is "Allow to access the administration form to configure Feedback message entities.", which kind of implies that is meant to be much deeper permission, and it's also defined as `admin_permission` in the FeedbackMessage entity.
A new `access feedback overview` permission could make sense, as that's the way the collection route permissions are usually defined. For example Taxonomy has
collection_permission = "access taxonomy overview"in its Entity definition.Comment #12
mparker17While writing tests in #3480990: Add automated tests, I ran into this problem as well.
I daresay calling it
access feedback message listwould be even more clear.FWIW, this wasn't proposed in the patch; but it also wasn't explicitly stated in any comments: I think a new permission to access the list of feedback message is better than replacing the
administer feedback message entitiespermission, becauseadminister feedback message entitiesis used in\Drupal\feedback\FeedbackMessageAccessControlHandler::checkFieldAccess()to control field access - and it is plausible for a site admin to want some users to see a list of feedback messages without letting them modify which fields are on feedback messages.Comment #13
mparker17This looks good to me now. I've merged it. Thanks everyone!