Skip to content

Commit

Permalink
bugfix(#48): fix access handling in ServiceInstanceAuthService
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoesle committed Dec 6, 2023
1 parent cd26540 commit ade351b
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);

Check warning on line 63 in digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/process/instance/domain/service/ServiceInstanceAuthService.java

View check run for this annotation

Codecov / codecov/patch

digiwf-engine/digiwf-engine-service/src/main/java/de/muenchen/oss/digiwf/process/instance/domain/service/ServiceInstanceAuthService.java#L63

Added line #L63 was not covered by tests
}

}
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 ade351b

Please sign in to comment.