Search in sources :

Example 46 with AuthManager

use of com.baidu.hugegraph.auth.AuthManager in project incubator-hugegraph by apache.

the class AuthTest method testProjectRemoveGraph.

@Test
public void testProjectRemoveGraph() {
    Id projectId = makeProjectAndAddGraph(graph(), "test_project", "graph_test");
    AuthManager authManager = graph().authManager();
    Assert.assertNotNull(projectId);
    HugeProject project = authManager.getProject(projectId);
    Assert.assertNotNull(project);
    Assert.assertFalse(project.graphs().isEmpty());
    projectId = authManager.projectRemoveGraphs(project.id(), ImmutableSet.of("graph_test"));
    project = authManager.getProject(projectId);
    Assert.assertNotNull(project);
    Assert.assertTrue(project.graphs().isEmpty());
}
Also used : AuthManager(com.baidu.hugegraph.auth.AuthManager) HugeProject(com.baidu.hugegraph.auth.HugeProject) Id(com.baidu.hugegraph.backend.id.Id) Test(org.junit.Test)

Aggregations

AuthManager (com.baidu.hugegraph.auth.AuthManager)46 Test (org.junit.Test)43 Id (com.baidu.hugegraph.backend.id.Id)39 HugeGraph (com.baidu.hugegraph.HugeGraph)36 HugeUser (com.baidu.hugegraph.auth.HugeUser)12 HugeProject (com.baidu.hugegraph.auth.HugeProject)8 HugeTarget (com.baidu.hugegraph.auth.HugeTarget)8 HugeGroup (com.baidu.hugegraph.auth.HugeGroup)7 HugeAccess (com.baidu.hugegraph.auth.HugeAccess)6 HugeBelong (com.baidu.hugegraph.auth.HugeBelong)6 HashMap (java.util.HashMap)6 Date (java.util.Date)5 UserWithRole (com.baidu.hugegraph.auth.UserWithRole)2 HugeResource (com.baidu.hugegraph.auth.HugeResource)1 RolePermission (com.baidu.hugegraph.auth.RolePermission)1 NotFoundException (com.baidu.hugegraph.exception.NotFoundException)1 Timed (com.codahale.metrics.annotation.Timed)1 Consumes (jakarta.ws.rs.Consumes)1 PUT (jakarta.ws.rs.PUT)1 Path (jakarta.ws.rs.Path)1