add RbacGrantsDiagramService.ALL_TEST_ENTITY_RELATED and helper method
This commit is contained in:
parent
266cd16b52
commit
72859015b3
@ -45,6 +45,7 @@ public class RbacGrantsDiagramService {
|
|||||||
NON_TEST_ENTITIES;
|
NON_TEST_ENTITIES;
|
||||||
|
|
||||||
public static final EnumSet<Include> ALL = EnumSet.allOf(Include.class);
|
public static final EnumSet<Include> ALL = EnumSet.allOf(Include.class);
|
||||||
|
public static final EnumSet<Include> ALL_TEST_ENTITY_RELATED = EnumSet.of(USERS, DETAILS, NOT_ASSUMED, TEST_ENTITIES, PERMISSIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -4,6 +4,7 @@ import net.hostsharing.hsadminng.context.ContextBasedTest;
|
|||||||
import net.hostsharing.hsadminng.persistence.HasUuid;
|
import net.hostsharing.hsadminng.persistence.HasUuid;
|
||||||
import net.hostsharing.hsadminng.rbac.rbacgrant.RbacGrantEntity;
|
import net.hostsharing.hsadminng.rbac.rbacgrant.RbacGrantEntity;
|
||||||
import net.hostsharing.hsadminng.rbac.rbacgrant.RbacGrantRepository;
|
import net.hostsharing.hsadminng.rbac.rbacgrant.RbacGrantRepository;
|
||||||
|
import net.hostsharing.hsadminng.rbac.rbacgrant.RbacGrantsDiagramService;
|
||||||
import net.hostsharing.hsadminng.rbac.rbacobject.RbacObject;
|
import net.hostsharing.hsadminng.rbac.rbacobject.RbacObject;
|
||||||
import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleEntity;
|
import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleEntity;
|
||||||
import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleRepository;
|
import net.hostsharing.hsadminng.rbac.rbacrole.RbacRoleRepository;
|
||||||
@ -254,6 +255,17 @@ public abstract class ContextBasedTestWithCleanup extends ContextBasedTest {
|
|||||||
.collect(toSet());
|
.collect(toSet());
|
||||||
}).assertSuccessful().returnedValue();
|
}).assertSuccessful().returnedValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a diagram of the RBAC-Grants to the current subjects (user or assumed roles).
|
||||||
|
*/
|
||||||
|
protected void generateRbacGrantsDiagram(final EnumSet<RbacGrantsDiagramService.Include> include, final String title) {
|
||||||
|
RbacGrantsDiagramService.writeToFile(
|
||||||
|
title,
|
||||||
|
diagramService.allGrantsToCurrentUser(include),
|
||||||
|
"doc/" + title + ".md"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RbacObjectRepository extends Repository<RbacObjectEntity, UUID> {
|
interface RbacObjectRepository extends Repository<RbacObjectEntity, UUID> {
|
||||||
|
Loading…
Reference in New Issue
Block a user