Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files for documentation for code PR 41496 "Control Access to Component Preferences Individually" #266

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions docs/general-concepts/acl/acl-component-prefs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Control Access to Component Preferences
=======================================

If you have more than a few component preferences you have probably already organised them into tabs, each tab holding related preferences. If those tabs represent very different parts of your component you may want to control access to each tabs individually.

All-or-nothing control is generally effected by granting or withholding the permission "core.options.permissions". This permission is part of the basic ACL set so there is no need to add it into your component's own access.xml file. It is accessed in the admin panel, for example for the users component, here.

![Joomla Access Component Permissions](_assets/permissionsAccess.jpg "Joomla Access Component Permissions")

You can further refine access by creating permissions for individual tabs within your component's permission set.

Take the options of the core component users as an example. It currently contains seven tabs apart from the permissions tab itself. A separate access permission that could be used for each these seven tabs could be created by adding the following lines to its /administrator/components/com_users/access.xml file.

```xml
<action name="core.options.user_options" title="COM_USERS_CONFIG_USER_OPTIONS" />
<action name="core.options.domain_options" title="COM_USERS_CONFIG_DOMAIN_OPTIONS" />
<action name="core.options.password_options" title="COM_USERS_CONFIG_PASSWORD_OPTIONS" />
<action name="core.options.multifactorauth" title="COM_USERS_CONFIG_MULTIFACTORAUTH_SETTINGS_LABEL" />
<action name="core.options.user_notes_history" title="COM_USERS_CONFIG_FIELD_NOTES_HISTORY" />
<action name="core.options.massmail" title="COM_USERS_MASS_MAIL" />
<action name="core.options.integration" title="JGLOBAL_INTEGRATION_LABEL" />
```

Then these extra options will appear in the permissions tab and can be controlled just the same as any others. Let's take as an example the ACL settings for managers. Setting them as

![Manager Access to User Preferences](_assets/managerPermissionAccess.jpg "Manager Access to User Preferences")

will result in managers only having access to four of the total user component preference tabs, as

![Manager User Preferences](_assets/managerUserOptions.jpg "Manager User Preferences")

the other preference tabs do not appear, preventing managers from being able to set their preferences.
2 changes: 2 additions & 0 deletions docs/general-concepts/acl/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ ACL stands for Access Control List.
Joomla ACL Access relates to what users can *view*.

Joomla ACL Permissions relate to what users can *do*.

Joomla ACL Can control access to component preferences.