ResourceTypePermissionValidator { public boolean isPermissionAllowed(ResourceType resourceType, ResourceAction permissionType) { return permissionMap.get(resourceType).stream().anyMatch(vp -> vp.getResourceAction().equals(permissionType)); } ResourceTypePermissionValidator(); @Inject  ResourceTypePermissionValidator(@Customizable final AppFormerActivities appFormerActivities, final OrganizationalUnitService organizationalUnitService,
                                           final WorkspaceProjectService projectService, final PermissionManager permissionManager); Set<Map.Entry<ResourceType, List<PermissionAction>>> getPermissionEntries(); boolean isPermissionAllowed(ResourceType resourceType, ResourceAction permissionType); Optional<PermissionAction> resourceDependancy(ResourceType resourceType, ResourceAction permissionType); boolean satisfyDependancies(PermissionCollection pc, ResourceType resourceType, ResourceAction resourceAction); boolean isValidResourceType(ResourceType resourceType, String resourceId);  }
@Test public void testIsPermissionAllowed() { assertTrue(permissionValidator.isPermissionAllowed(OrganizationalUnit.RESOURCE_TYPE, READ)); assertTrue(permissionValidator.isPermissionAllowed(ActivityResourceType.PERSPECTIVE, READ)); assertFalse(permissionValidator.isPermissionAllowed(ActivityResourceType.EDITOR, CREATE)); assertTrue(permissionValidator.isPermissionAllowed(Repository.RESOURCE_TYPE, BUILD)); }