if (perms == null || !perms.isAllowed(Permission.READ)) {
perms = Permissions.grantRead(perms);
map.put(entity.getID(), roleId, perms);
setDirty(entity);
}
IntegrationEntity owner = entity.getParent();
while (owner != null) {
if (!cyclicDependencyGuard.contains(owner)) {
grantReadPermissionImpl(role, roleId, owner, cyclicDependencyGuard);
}
owner = owner.getParent();
}
for (IntegrationEntity req : dependencies.getRequiredObjects(entity)) {
if (!cyclicDependencyGuard.contains(entity)) {
grantReadPermissionImpl(role, roleId, req, cyclicDependencyGuard);
}