Kiple wrote:
For the Front end :
Every User is part of a ARO group
The actions (ACO) for com_content would be add, edit, publish
The ACL would then link the ARO groups to the ACO
A user would then be able to view any menu, content, etc assigned to the level of his ARO group (or parent groups) and if by ACL permission also add, edit or publish.
I don't understand how AXO could be assigned at the content level. I thought AXO would be used to assign a set of rights that don't fit easily/simply into the group hierarchy, for example, give the marketing group rights to control publishing on the public site, give Human resources the rights to control publishing on the Intranet.
Hi kiple,
your not exactly right with your assumption. First of all, there is no difference for the ACLs if its backend or frontend and there is no need to put every ARO (e.g. user) into a group. The only thing you have to do, is putting every object (no matter if ARO, ACO, AXO or ACL) into a section, but this is only for the sake of the users overview (Think about a site with 10.000 users. All in one big list would be terrible inconvenient. Its inconvenient now allready, because all object, sections and groups are send over to the Admin each time he loads the ACL admin-page. Way to much traffic, have to put ajax in here...). You can then assign actions (ACOs) to users or user-groups (ARO or ARO-groups). You can assign multiple groups to one user (for example a guy who is a forum moderator, publisher and maintainer for one special fork of your site). When you need more granularity than actions the user is allowed to perform, you can add AXOs, which would be the content. (for example allow user1 to view the article about really big mice and user2 only the article about the small and pretty ones) Again you can use Groups as with the users.
Quote:
I have two questions.
1. Typically menu/content/etc are selected with an sql statement including a where statement like
"access <= $my->gid"
For it to be selected using the ARO groups this would need to be
"access in [$my->gid or any parent group]"
How can the parent ARO group list be generated?
You would not create an ARO parent list. For this you have the function acl_check. Your typical call would look like this:
Code:
if ($acl->acl_check($aco_section_value, $aco_value, 'users', $my->id, $axo_section_value, $axo_value)) {
This function automatically checks if the user which is currently logged in is allowed to take the requested action, no matter in which group he would be. The AXOs are not necessary, if you use them, you would have to most likely hand over the content-id and you would get a true/false back, or, if specified, a certain return value. To summarize: You don't need to do anything, except calling this function and hand over the user, the action he is requesting and optionally the item he wants to perform the action on. Then you will get a true/false in return, where false is the standard value if no rule applies.
Quote:
2. When a user adds a content item, it can be assigned to their ARO group or any above.
How can the default be set to the User level?
For Example, assume we have two user groups Red & Blue
We then have Red Authors, Red Editors and Red Publishers, similar for Blue
If content is added by a Red Author its access level should not be "Red Authors" but "Red User"
As I wrote above, the content would not be automatically assigned to a certain user-group. It can be assinged to a special AXO-Group and all users that have rights on this group, can view. (or edit, or delete, etc. depending on what is set in the rules)
@emeyer
emeyer wrote:
Because permissions do not always fall in hierarchical relationships. As to the UI, those folks who need complex access levels are not going to be intimidated by complexity. In fact they will welcome it. I think it would be a mistake to 'dumb it down'.
I think developers may prefer setting up groups with XML files, and in many cases a mambot to implement permissions would make things alot easier. Just my two cents, you're welcome to disagree.
to 1.: As written above, there is a function that checks if the user currently logged in is allowed to perform that action (on this content). This is absolutely non hierarchical. You can create your own user groups in a flat structure and give each of them different rights. If you form a tree, higher groups just inherit the rights of lower groups.
to 2.: I thought about a way to install ACL-rules, objects and groups by a xml-file. The idea was to enrich the normal installer with these commands to prevent the 3PD from having to mess with the whole thing themself.
I don't know if this was what you had in mind, if you think of a permanently xml-based user-rights-managment, I don't think that would work. The performance of my solution is not really tested at the moment and on my testserver it needs 6-8 ms to make a query, which is in my opinion to long. (I got these values from the generic ACL-interface, which is based on ADOdb and I hope that the rewritten API to work with the Joomla db-layer will work faster than ADOdb) XML on the other hand is as far as I know at the moment the biggest resource waster in Joomla and a reason a lot of people have trouble with their sites. I will push the idea of an xml-format to install/add ACL-objects, but I wont support an xml-based ACL.