bug5723: RoleDefinitions produced from RolePrototypes during a server initialization/migration are now made READable for all

This commit is contained in:
Axel Uhl
2022-05-11 14:51:54 +02:00
parent 20c2db36e9
commit 5370a3a464
4 changed files with 21 additions and 13 deletions
@@ -2119,7 +2119,7 @@ implements ReplicableSecurityService, ClearStateTestSupport {
}
@Override
public RoleDefinition getOrCreateRoleDefinitionFromPrototype(final RolePrototype rolePrototype) {
public RoleDefinition getOrCreateRoleDefinitionFromPrototype(final RolePrototype rolePrototype, boolean makeReadableForAll) {
final RoleDefinition potentiallyExistingRoleDefinition = store.getRoleDefinition(rolePrototype.getId());
final RoleDefinition result;
if (potentiallyExistingRoleDefinition == null) {
@@ -2135,6 +2135,10 @@ implements ReplicableSecurityService, ClearStateTestSupport {
} else {
result = potentiallyExistingRoleDefinition;
}
if (makeReadableForAll && isInitialOrMigration()) {
// make role publicly readable
addToAccessControlList(result.getIdentifier(), /* for all users */ null, DefaultActions.READ.name());
}
return result;
}