Fix tenant scope on retrieval of target groups (#2847)
* Fix tenant scope on retrieval of target groups Signed-off-by: strailov <Stanislav.Trailov@bosch.io> * fix build Signed-off-by: strailov <Stanislav.Trailov@bosch.io> --------- Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
This commit is contained in:
committed by
GitHub
parent
e6367d0b0c
commit
3bc8a91883
@@ -381,8 +381,8 @@ public class JpaTargetManagement
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findGroups() {
|
||||
return jpaRepository.findDistinctGroups();
|
||||
public List<String> findGroups(String tenant) {
|
||||
return jpaRepository.findDistinctGroups(tenant);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -102,6 +102,6 @@ public interface TargetRepository extends BaseEntityRepository<JpaTarget> {
|
||||
* Finds all available distinct target groups
|
||||
* @return all target groups
|
||||
*/
|
||||
@Query(value = "SELECT DISTINCT target_group FROM sp_target WHERE target_group IS NOT NULL", nativeQuery = true)
|
||||
List<String> findDistinctGroups();
|
||||
@Query(value = "SELECT DISTINCT target_group FROM sp_target WHERE tenant = ?1 AND target_group IS NOT NULL", nativeQuery = true)
|
||||
List<String> findDistinctGroups(@Param("tenant") String tenant);
|
||||
}
|
||||
Reference in New Issue
Block a user