mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-23 06:06:11 +00:00
bug5723: RoleDefinitions produced from RolePrototypes during a server initialization/migration are now made READable for all
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user