private boolean objectBelongsToTheRightTenant(final UUID objectId, final ObjectType objectType, final TenantContext context) throws ObjectDoesNotExist { final Long realTenantRecordId = getTenantRecordIdSafe(context); if (realTenantRecordId == null) { throw new ObjectDoesNotExist(String.format("Tenant id=%s doesn't exist!", context.getTenantId())); } return objectBelongsToTheRightTenant(objectId, objectType, realTenantRecordId); }
private boolean objectBelongsToTheRightTenant(final UUID objectId, final ObjectType objectType, final TenantContext context) throws ObjectDoesNotExist { final Long realTenantRecordId = getTenantRecordIdSafe(context); if (realTenantRecordId == null) { throw new ObjectDoesNotExist(String.format("Tenant id=%s doesn't exist!", context.getTenantId())); } return objectBelongsToTheRightTenant(objectId, objectType, realTenantRecordId); }
private boolean objectBelongsToTheRightTenant(final UUID objectId, final ObjectType objectType, final Long realTenantRecordId) throws ObjectDoesNotExist { final Long objectTenantRecordId = getTenantRecordIdUnsafe(objectId, objectType); if (objectTenantRecordId == null) { throw new ObjectDoesNotExist(String.format("Object id=%s type=%s doesn't exist!", objectId, objectType)); } return objectTenantRecordId.equals(realTenantRecordId); }
private boolean objectBelongsToTheRightTenant(final UUID objectId, final ObjectType objectType, final Long realTenantRecordId) throws ObjectDoesNotExist { final Long objectTenantRecordId = getTenantRecordIdUnsafe(objectId, objectType); if (objectTenantRecordId == null) { throw new ObjectDoesNotExist(String.format("Object id=%s type=%s doesn't exist!", objectId, objectType)); } return objectTenantRecordId.equals(realTenantRecordId); }