Problem/Motivation
As of Drupal 9.3 each node bundle has it's own permissions tab, e.g. /admin/structure/types/manage/basic_page/permissions
The Node View Permissions permissions are missing there and it would be really convenient to see them there.
Steps to reproduce
- Install node_view_permissions module
- Create a node bundle named "basic_page"
- Navigate to /admin/structure/types/manage/basic_page/permissions
Proposed resolution
I would prefer the Node View Permissions to be added to the permissions tab itself. However, I've looked into the core implementation and I don't see an obvious way to achieve that.
So maybe a more reasonable solution would be to add a seperate tab for "View permissions" right next to the "Permissions" tab.
Remaining tasks
- Build View Permissions form to handle the permissions for a single node bundle
- Display the form on a "View permissions" tab next to the "Permissions" tab
User interface changes
A new tab "View permissions" with a seperate form to handle the permissions.
API changes
Data model changes
Issue fork node_view_permissions-3330335
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
anybodyComment #3
guido_sI think the publication_date module solved this in a good way using permission callbacks in its permissions.yml and then extending the NodePermissions class.
Something like this could be used here too.
Comment #5
guido_sI added it like that and opened a merge request.
Please test if everything works as expected.
Comment #6
guido_sWe need to check if the core version requirements in the info file need to be changed for this. I currently don't know if the NodePermissions class existed in Drupal 8 and only the bundle permissions trait was added later or something like that.
Comment #7
elkaro commentedWorking as expected for me. Looks great!
I agree with @guido_s. The NodePermissions class was added on 9.4 (Change record)
So a version of the module specifying that as the minimum core requirement would satisfy the requirements for this issue fork to be merged.
Switching to Needs work, but I think this is RTBC once a release with the updated core version requirement comes out.
Comment #8
anybodyDrupal 9 is EOL, I think we could require Drupal 10 as minimum, maybe even 10.3!
Comment #9
nagy.balint commentedNow 2.x is Drupal 10+
Comment #11
nagy.balint commentedThanks!