The only thing that controls login to the mgr are permissions to the mgr context. The user will have to be a "Super User" member of Administrators to login to the mgr context with the permissions provided out of the box. Assigning Context policies to contexts other than mgr is a way to provide permissions for users to perform content management activities FROM scripts in that context. It has nothing to do with content management of that context.
I’ve created a user group which will have permission to manage a context, and created a user and added them to that group.
I’ve then created a new context, assigned the user group permission to the context, then tried to login as the user.
On login, the user gets: "Error! Permission denied!" with a logout link. When you click Logout, you get: "{"success":true,"message":"","total":0,"data":[],"object":[]}."
If you assigned a policy to the new context, make sure the Administrators group can access it. This gets a bit complex, and there were some bugs in beta-1 that have already been fixed that will show up if you try to add more than one policy that applies to a single person, but it should basically be working as expected. Context policies serve both as policies for managing access to the Context itself (can I even load the data object), as well as providing attributes which define permissions to perform various actions when taken from that context (can I save changes to a Chunk from a script running in the mgr context, or similarly, from the web context).
When you then log back in as the Admin user, the context has vanished, but it’s still there somewhere because you cannot create a new context with the same key (get an error.)
The only thing that controls login to the mgr are permissions to the mgr context. The user will have to be a "Super User" member of Administrators to login to the mgr context with the permissions provided out of the box. Assigning Context policies to contexts other than mgr is a way to provide permissions for users to perform content management activities FROM scripts in that context. It has nothing to do with content management of that context.
If you assigned a policy to the new context, make sure the Administrators group can access it. This gets a bit complex, and there were some bugs in beta-1 that have already been fixed that will show up if you try to add more than one policy that applies to a single person, but it should basically be working as expected.
Again, I know this seems quite complicated, and in some aspects it is, but once we better document how this all fits together, I think you’ll be pleasantly surprised at the things you can do with it.
Yes. Even, with ABAC controls, if you so desired, you can get even more fine grained - you could give a user access to save only Chunks in the ’foo’ context by using a custom Access Policy.
Ah OK, that’s my mis-understanding. Is this sort of behaviour planned for MODx Revo? I.e. being able to create a user group (or whatever) so that certain users can only see and manage defined contexts?
Correct - they have been merged. Now users span all ’contexts’ (web/mgr are two separate contexts), but can be restricted to only have access to one, both, or neither.
I guess the difference in user behaviour is that there are no longer "web" and "manager" users, just "users", right?
Also how would we go about creating a user that can login to the manager and edit content, but couldn’t touch the "system-wide" settings, such as contexts and configuration etc?
What attributes are defined with a value of true in the policy you have assigned to this context? Here are the attributes you will need, at a minimum, for it to show up:
Yes I did apply a policy to this context, unfortunately this context is not showing up anywhere in the system for the admin user. On a side note (I will raise this in Jira) you can’t edit a user group - you click the "Update User Group" menu item and it just shows the form for creating a new group.
Now I’ve managed to login as my "normal" user, that context isn’t showing up for them either! I guess the only way to get it back is delete it from the db directly?
What attributes are defined with a value of true in the policy you have assigned to this context? Here are the attributes you will need, at a minimum, for it to show up:
[table]
[tr][td]list [/td][td]true[/td][/tr]
[tr][td]load [/td][td]true[/td][/tr]
[tr][td]view [/td][td]true[/td][/tr]
[/table]
[2009-06-19 17:10:52] (ERROR @ /connectors/context/index.php) modManagerLog: Attempt to set NOT NULL field item to NULL
What authority did you give in the access permission you created for the test context and what authority does the user have in the Administrator group? That is the key. If you did not make the user a Super User (authority 0) rather than Member (authority 9999) and you gave the Access Permission an authority of 0, he will not be able to see the context.
I’ve just tried again and made a note of what I did (all as Administrator.)
1. Create context test.
2. Logout, log back in, check it’s still there - yes
3. Assign the Context access permission to the test context and Administrator user group
4. Logout, log back in, it’s vanished.