Namespace permissions per module

Created on 16 May 2016, about 8 years ago
Updated 14 December 2023, 6 months ago

Problem/Motivation

If you have two modules that declare the same permission name, the manage permissions form only shows one.

e.g.

opt-in or out of tracking:
  title: 'Opt-in or out of tracking'
  description: 'Allow users to decide if tracking code will be added to pages or not.'
use PHP for tracking visibility:
  title: 'Use PHP for tracking visibility'
  description: 'Enter PHP code in the field for tracking visibility settings.'
  restrict access: true

Proposed resolution

Namespace permissions to the provider they came from.

e.g. `node:create page content`

Remaining tasks

Add support
Add test coverage
Write BC layer (e.g. calls to add a permission should just work if the provider isn't added, but log a deprecation error).
Update path for roles

User interface changes

None

API changes

None.

Data model changes

Maybe

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
User moduleΒ  β†’

Last updated 1 minute ago

Created by

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.

  • πŸ‡ΊπŸ‡ΈUnited States anoopjohn Washington D. C.

    Is that all you need to enforce namespacing and preventing collisions?

    Don't we want to enforce module name prefix when we are loading permissions from the file

    Also any reason whey we can't auto prefix the module name to the permission name when we load permissions from the file?

Production build 0.69.0 2024