Skip to content

Commit

Permalink
PIN-4488 Fix roles
Browse files Browse the repository at this point in the history
  • Loading branch information
nttdata-rtorsoli committed Feb 7, 2024
1 parent 1193ee0 commit 26128f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.7.2
sbt.version=1.5.8
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ final case class CatalogManagementServiceImpl(invoker: CatalogManagementInvoker,
): Future[PaginatedResult[CatalogItem]] = for {
role <- getUserRolesFuture(contexts)
roles = Seq(ADMIN_ROLE, API_ROLE)
isSuperVisor = roles.intersect(role.split(",")).nonEmpty
eservices <- ReadModelCatalogQueries.getEServices(
requesterId,
name,
Expand All @@ -290,10 +291,10 @@ final case class CatalogManagementServiceImpl(invoker: CatalogManagementInvoker,
offset,
limit,
exactMatchOnName,
roles.contains(role)
isSuperVisor
)
filtered =
if (!roles.contains(role))
if (!isSuperVisor)
eservices.results.map(ese => ese.copy(descriptors = ese.descriptors.filterNot(_.state == Draft)))
else
eservices.results.map(ese =>
Expand Down

0 comments on commit 26128f5

Please sign in to comment.