Quote from: therebechips at Jul 07, 2009, 03:57 AM
Apologies if this is a stupid question, but I’m getting rather lost getting my head round user access concepts in Revo.
I’m building a web application that requires granular permissions. Essentially I have a checklist list of things that each user can do, eg:
* Modify your firm’s profile
* Create and modify user accounts and set access permissions for staff at your firm
* Create and modify SEPIC data for your firm
* Create and modify firm news
* Create and modify referrals that your firm has made
These would be configurable only for users that belong to a user group I’ve called ’firm_member’.
There would be a separate list of configurable permissions for another user group.
Is it possible to set this up in Revo or should I be creating custom tables?
Many thanks for your help.
EDIT: I should point out that the administration screens for the above would be entirely separate from the Manager interface
You’ll want to create an "Access Policy" with all the permissions that you want - say, ’modify_profile’, ’create_news’, etc. Let’s call it "FirmPolicy" for example.
Then you’ll go to Access Permissions, and add an ACL to the first grid for your ’firm_member’ User Group so that it has access to the ’web’ context (I’m assuming that’s where you’re building this). Give it an arbitrary authority of, say, 10. For the policy, select the "FirmPolicy" policy you just created.
If you want this policy only on certain Resources, create a Resource Group, and then assign in the 2nd grid in Access Permissions a link between the User Group and Resource Group with the "FirmPolicy" policy.
Then, from there, flush your permissions.
Now to use the policy permissions, in your script, simply do:
if (!$modx->hasPermission('create_news')) { return 'Access Denied!'; } // or something of the sort