Archived:Access Control System In Joomla 1.6
From Joomla! Documentation
Overview
Sections
Sections are used to group rules, actions for each extension using the table jos_access_sections
Users
These are users stored in jos_users table. Please note that gid and usertype fields are only there for legacy purposes and are not used in the current ACL system. Users can be mapped to rules via jos_user_rule_map table. in phpGACl, users were called AROs (Access Request Object)
User Groups
These are user groups that are hold in table jos_usergroups. You can have nested user groups. Each group obviously can hold an unlimited number of users and each user can be assigned to an unlimited number of user groups. These relations are hold in the table jos_user_usergroup_map. User groups can be mapped to rules via jos_usergroup_rule_map table.
Actions
Actions are things your users will perform such that logging in to backend
Assets
Assets are items that you need to set access control on. For example each article on your site can be an asset and you can set edit permission for them. Currently these are not used in core.
Asset Groups
These are used for creating different view permissions for a combination of usergroups. (???) How this is achieved:
- First a view action is created with access type 3. (eg. core.view)
- Then an asset group is created with some user groups in it.
- A rule is set with the name convention {action_name}.{asset_group_id} (eg. core.view.1 for Public)
- Both action, assetgroup and user groups are mapped to this rule.
- When three of them maps to the same rule JUser::getAuthorisedLevels() will also return the new asset group id.
Rules
Rules are combinations of actions and usergroups (or users) and optionally assets There are three types of rules:
- Type 1: These are rules that allow a user or user group to do an action. For example user group X can log in to backend.
- Type 2: These are rules that allow a user or user group to do an action on an asset. For example user group X can edit an article with the id of Y.
- Type 3: These are rules that allow a user or user group to do an action (mostly view) on an asset group. For example user group X can view articles with the asset group of Y. (???)
Library
TODO
Examples
Core Access Levels
There are three access levels in core by default Public, Registered, Special. These are access levels. For them we use the action core.view. Let's use Special for our example: First of all there is an asset group named Special. We need to tie some user groups to it and selecting Manager is enough. Because the system will automatically include its child groups (being Administrator and Super Administrator by default) The rule needed for this level is core.view.3. As you remember naming convention is action_name.asset_group_id and here our id is 3.