class AppServiceImpl implements AppService, ApplicationListener<ConfigChangedEvent> {

    @Transactional(readOnly = true)
    @Override
    public List<App> findAppsByUserIdOrRole(int userId) {
        User user = userRepository.findById(userId);
        if (User.TYPE_MANAGER.equals(user.getType())) {
            return findAll();
        }
        return findAppsByUserId(userId);
    }

}