Skip to content

Commit

Permalink
bugfix(#48): fix access handling in ServiceInstanceAuthService (#1082)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoesle authored Dec 7, 2023
1 parent afa5786 commit d37c14c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void createAuthorization(final String processInstanceId, final String use
* @return
*/
public boolean hasAccess(final String instanceId, final String userId) {
return this.processInstanceAuthorizationRepository.findByUserIdAndProcessInstanceId(userId, instanceId).isPresent();
return this.processInstanceAuthorizationRepository.existsByUserIdAndProcessInstanceId(userId, instanceId);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

/**
* Repository to perform db operation on a {@link ServiceInstanceAuthorizationEntity}
Expand All @@ -19,5 +18,5 @@ public interface ProcessInstanceAuthorizationRepository extends JpaRepository<Se

List<ServiceInstanceAuthorizationEntity> findAllByUserId(String userId);

Optional<ServiceInstanceAuthorizationEntity> findByUserIdAndProcessInstanceId(String userId, String processInstanceId);
boolean existsByUserIdAndProcessInstanceId(String userId, String processInstanceId);
}

0 comments on commit d37c14c

Please sign in to comment.