allow-multiple-insert-permission-grants #49
@ -5,7 +5,6 @@ import net.hostsharing.hsadminng.rbac.rbacdef.RbacView.CaseDef;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.nio.file.*;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
@ -133,7 +132,7 @@ public class RbacViewMermaidFlowchartGenerator {
|
||||
final var grantsOfRequestedType = rbacDef.getGrantDefs().stream()
|
||||
.filter(g -> g.grantType() == grantType)
|
||||
.filter(rbacDef::renderInDiagram)
|
||||
.filter(this::isToBeRenderedInThisGraph)
|
||||
.filter(this::isToBeRenderedForThisCase)
|
||||
.toList();
|
||||
if ( !grantsOfRequestedType.isEmpty()) {
|
||||
flowchart.ensureSingleEmptyLine();
|
||||
@ -142,8 +141,8 @@ public class RbacViewMermaidFlowchartGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isToBeRenderedInThisGraph(final RbacView.RbacGrantDefinition g) {
|
||||
if ( g.grantType() != ROLE_TO_ROLE )
|
||||
private boolean isToBeRenderedForThisCase(final RbacView.RbacGrantDefinition g) {
|
||||
if ( g.grantType() == ROLE_TO_USER )
|
||||
return true;
|
||||
if ( forCase == null && !g.isConditional() )
|
||||
return true;
|
||||
|
@ -85,7 +85,6 @@ role:asset:TENANT ==> role:bookingItem:TENANT
|
||||
|
||||
%% granting permissions to roles
|
||||
role:bookingItem:AGENT ==> perm:asset:INSERT
|
||||
role:parentServer:ADMIN ==> perm:asset:INSERT
|
||||
role:asset:OWNER ==> perm:asset:DELETE
|
||||
role:asset:ADMIN ==> perm:asset:UPDATE
|
||||
role:asset:TENANT ==> perm:asset:SELECT
|
||||
|
@ -85,7 +85,6 @@ role:asset:TENANT ==> role:bookingItem:TENANT
|
||||
|
||||
%% granting permissions to roles
|
||||
role:bookingItem:AGENT ==> perm:asset:INSERT
|
||||
role:parentServer:ADMIN ==> perm:asset:INSERT
|
||||
role:asset:OWNER ==> perm:asset:DELETE
|
||||
role:asset:ADMIN ==> perm:asset:UPDATE
|
||||
role:asset:TENANT ==> perm:asset:SELECT
|
||||
|
@ -84,8 +84,6 @@ role:asset:ADMIN ==> role:asset:TENANT
|
||||
role:asset:TENANT ==> role:bookingItem:TENANT
|
||||
|
||||
%% granting permissions to roles
|
||||
role:bookingItem:AGENT ==> perm:asset:INSERT
|
||||
role:parentServer:ADMIN ==> perm:asset:INSERT
|
||||
role:asset:OWNER ==> perm:asset:DELETE
|
||||
role:asset:ADMIN ==> perm:asset:UPDATE
|
||||
role:asset:TENANT ==> perm:asset:SELECT
|
||||
|
Loading…
Reference in New Issue
Block a user