Code must be added whenever a new restriction is needed:
- Add a suggestion to lib/settings/utils.py:get_permissions_suggestions
- Follow a URL-like pattern, for example agent/accountsReceivable/makePayment
- optgroup is a readable category, for example Agent Accounts Receivable
- Check the new permission path in the get block of the page in which you are working, for example (“${check_permissions(‘agent/policies/accountsReceivable/makePayment’)}” == ‘True’)
- check_permissions defaults to requiring the read permission and may need to be imported into the page template
- Add Javascript/HTML to control the visibility of the new element
- New KO pages
- Use <element data-bind=”visible: get.permissionVar”> OR
- Use the get.permissionVar in a computed function
- Legacy pages
- Track down the relevant build or draw function
- Use get.permissionVar and $$(‘el-selector’).show() or hide()
- New KO pages
- Once the code is in place, build the rule as you would when restricting a module or page