Repository navigation
Preserve existing ACLs for the everyone principal #918
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
Changes from 3 commits
844fa6a
af52f9f
3344bdd
1efd057
dcb2256
1251f78
34c676b
dc38126
d095420
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,8 @@ | |
|
|
||
| import org.apache.commons.lang3.StringUtils; | ||
|
|
||
| import biz.netcentric.cq.tools.actool.helper.Constants; | ||
|
|
||
| /** User and group part of the AC Tool configuration (natural ordered set of AuthorizableConfigBeans). */ | ||
| public class AuthorizablesConfig extends LinkedHashSet<AuthorizableConfigBean> { | ||
| private static final long serialVersionUID = -253685832563496002L; | ||
|
|
@@ -31,6 +33,10 @@ public class AuthorizablesConfig extends LinkedHashSet<AuthorizableConfigBean> { | |
|
|
||
| @Override | ||
| public boolean add(AuthorizableConfigBean configBean) { | ||
| if (StringUtils.equals(configBean.getPrincipalName(), Constants.PRINCIPAL_EVERYONE) | ||
| && StringUtils.isEmpty(configBean.getUnmanagedAcePathsRegex())) { | ||
| configBean.setUnmanagedAcePathsRegex(".*"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now it does |
||
| } | ||
| AuthorizableConfigBean previous = configBeansByPrincipalId.put(configBean.getPrincipalName(), configBean); | ||
| assert previous == null; | ||
| return super.add(configBean); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -332,7 +332,7 @@ To configure permissions for already existing users/groups, it's best to create | |
| This is not an option for the [`everyone` group](https://jackrabbit.apache.org/oak/docs/security/user/default.html#Everyone_Group) as it is neither allowed to put groups/users as members to this group (because implicitly every principal is member of this group) nor to put this group as member to another group (to prevent cycles, compare with [OAK-7323](https://issues.apache.org/jira/browse/OAK-7323)). | ||
| Also in case of using [Sling Service Authentication bound to principals](https://sling.apache.org/documentation/the-sling-engine/service-authentication.html#service-user-mappings)(available since AEM 6.4) you cannot use group memberships, as the principal mapping does not consider (transitive) group memberships. Those mappings can be identified by looking up the according `org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended` configuration instance with its `user.mapping` property. It that has the format `<service-name>[:<subservice-name>]="["<principal name>{","<principal name>}"]"` (look for square brackets) it is a principal mapping. | ||
|
|
||
| In those cases just list the built-in authorizable (user/group) in the YAML file (with the correct authorizable id) and leverage `unmanagedAcePathsRegex` as outlined below. No other properties need to be set on the authorizable as this is in fact not touched by the ACTool. Alternatively just extend the permissions with [Repository Initialization (repoinit)](https://sling.apache.org/documentation/bundles/repository-initialization.html). | ||
| In those cases just list the built-in authorizable (user/group) in the YAML file (with the correct authorizable id) and leverage `unmanagedAcePathsRegex` as outlined below. No other properties need to be set on the authorizable as this is in fact not touched by the ACTool. When `everyone` is listed without an `unmanagedAcePathsRegex`, the AC Tool defaults it to `.*` so existing ACEs for this principal are not removed (including repo level ACEs). To manage selected paths for `everyone`, explicitly configure a regex that excludes all other paths. Alternatively just extend the permissions with [Repository Initialization (repoinit)](https://sling.apache.org/documentation/bundles/repository-initialization.html). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @copilot This is no longer true, when there is no unmanagedAcePathsRegex set for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the documentation to clarify that omitting the regex preserves existing |
||
|
|
||
| ### Configure memberships of/towards externally managed groups | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Add a WARNING to the history about the added unmanaged ace paths regex when this is installed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a history WARNING when
everyoneis installed with the defaultunmanagedAcePathsRegex: .*, including guidance to configure a narrower regex. Commit:1efd057.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot In order to not warn when this is set explicitly, please remove setting it implicitly here but only when installing ACEs.