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