there can be multiple INSERT permissions for a single targetObject
This commit is contained in:
parent
c56d06072a
commit
d98c8ef8d3
@ -94,12 +94,14 @@ public class RbacGrantsDiagramService {
|
||||
}
|
||||
|
||||
public String allGrantsFrom(final UUID targetObject, final String op, final EnumSet<Include> includes) {
|
||||
final var refUuid = (UUID) em.createNativeQuery("SELECT uuid FROM rbac.permission WHERE objectuuid=:targetObject AND op=:op")
|
||||
final var graph = new LimitedHashSet<RawRbacGrantEntity>();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
final var refUuids = (List<UUID>) em.createNativeQuery("SELECT uuid FROM rbac.permission WHERE objectuuid=:targetObject AND op=:op", List.class)
|
||||
.setParameter("targetObject", targetObject)
|
||||
.setParameter("op", op)
|
||||
.getSingleResult();
|
||||
final var graph = new LimitedHashSet<RawRbacGrantEntity>();
|
||||
traverseGrantsFrom(graph, refUuid, includes);
|
||||
.getResultList();
|
||||
refUuids.forEach(refUuid -> traverseGrantsFrom(graph, refUuid, includes));
|
||||
return toMermaidFlowchart(graph, includes);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user