It is possible to use a "warning" key on permissions to provide a custom explanation of why a permission is dangerous.
However this is never used in core and I have never seen it used in contrib module.
One of the reasons is that it is poorly documented, but also the PermissionHandlerInterface::getPermissions() docblock does not recommend using this key because it overrides the default warning.
I think it would be better to always keep the default warning (because site admins are used to seeing it and now what it means) but allow adding additional context about why the permission is dangerous.
Add a custom permission:
insert javascript:
title: 'Insert custom JavaScript into pages'
restrict access: true
warning: 'This permissions is dangerous because it allows injecting arbitrary JS'
The custom warning could be appended to the default warning.
Backdrop does something similar (see https://github.com/backdrop/backdrop-issues/issues/5536).
Active
11.0 🔥
user system
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.