Permission system improvements and new permission keys#3396
Conversation
b2b8b9e to
d4513b1
Compare
…SBilling/FOSSBilling into feature/improved_permissions
0b76ffa to
2b81dec
Compare
2b81dec to
f595a62
Compare
|
Removing All staff members could access hooks since permissions were hidden; now they need explicit grants. Non-admin staff will lose hook access until an admin grants these new permission keys. Maybe this is intentional? Should we not document the change or migrate existing permissions? |
It's intentional. It wasn't hidden behind a permission key like before, just like every other permission key introduced with this PR. In theory they should just lose view access and the ability to manually trigger hooks via API. Which can be easily reinstated if wanted. I don't think this disables hooks entirely for the user, but we should check and verify that in any case. |
b9b7b13 to
082e4d7
Compare
admdly
left a comment
There was a problem hiding this comment.
LGTM - incorporated some small corrections (as I know you're busy) and agreed code to get this ready to merge.
System improvements
hide_permissionsandcan_always_access. Previously, setting either of them would grant automatic full access to the module that couldn't be disabled at all.can_always_accesswould be used to grant everyone access buthide_permissionsshould only be used to hide permissions for modules like Branding where you don't actually have anything to guard.New Twig function
has_permissionTwig function so we can safely leave out parts of the UI that the user isn't authenticated for.{% if has_permission('client', 'create') %} {# Check for a permission key #} {% if has_permission('client') %} {# Check for module access #}New permission keys
Created ~25 new permission keys. I think the Client and System ones are especially beneficial to control granular access.
createedit_profileimpersonate_loginmanage_api_keyschange_passwordmanage_balanceview_login_historymanage_groupsdeletebulk_deleteexportupdate_paramsrecheck_updatetoggle_error_reportingcreateeditdeleteset_defaultupdate_ratescreate_and_editdeletemanage_hookstrigger_hooks