bug4811: completed first untested implementation of PermissionChangeListeners

This commit is contained in:
Axel Uhl
2021-02-03 16:52:05 +01:00
parent 842cf85b24
commit 84fdaae2b5
8 changed files with 217 additions and 68 deletions
@@ -386,6 +386,12 @@ public class AccessControlStoreImpl implements AccessControlStore {
}
}
}
@Override
public Iterable<OwnershipAnnotation> getOwnerhipsWithGroupOwner(UserGroup owningUserGroup) {
final Set<OwnershipAnnotation> ownerships = userGroupToOwnership.get(owningUserGroup);
return ownerships==null ? Collections.emptySet() : Collections.unmodifiableCollection(ownerships);
}
@Override
public OwnershipAnnotation getOwnership(final QualifiedObjectIdentifier idOfOwnedObjectAsString) {
@@ -706,6 +706,13 @@ public class UserStoreImpl implements UserStore {
});
}
@Override
public Iterable<UserGroup> getUserGroupsWithRole(RoleDefinition roleDefinition) {
return LockUtil.executeWithReadLockAndResult(userGroupsLock, () -> {
return roleDefinition == null ? null : new HashSet<>(roleDefinitionsToUserGroups.get(roleDefinition));
});
}
@Override
public UserGroup getUserGroup(UUID id) {
return LockUtil.executeWithReadLockAndResult(userGroupsLock, () -> {