Add simple widget to manage content view permissions on node form

Created on 19 May 2017, about 7 years ago
Updated 12 December 2023, 7 months ago

For my use case, which I imagine might be a very common one, the content access per node settings would be to complicate for an average web editor. I just wanted a simple setting on the node form to control the view content permission.

Therefore I created the sandbox module Content Access Lite β†’ which adds an extra-field to the node form to exposed the view content permission there. To make the setting more clear for editors radio buttons where used, but a simple checkbox might would have done just fine.

The module just build on the top of Content Access the way, that it could be installed or uninstalled without influencing the content access settings. The content access settings could be still set via it's default settings form, if permissions are granted. The widget on the content form does not require any additional permissions except the add/update content permissions.

There is one small difference to Content Access module: If the settings, set in content form, matches the default settings they won't be saved to the content_access table as it is not necessary; the record will be removed if it already exists to allow the default setting be used – see #2879479: Default settings should match the per node default settings β†’ .

If the maintainers like we could integrate the functionality into Content Access module or bundle it as a sub-module. Otherwise, if there is some community interest I could publish the sandbox module as a regular module.

I would appreciate if people could review the module. I am not sure if it is the Drupal 8 way of doing things, as it still uses procedural code. Maybe there also needs to be done more work on the Content Access module to convert it into a more API like module with set and revoke permission functions to enable the implementation of different widgets.

✨ Feature request
Status

Closed: outdated

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany osopolar πŸ‡©πŸ‡ͺ GER 🌐

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024