Search in sources :

Example 6 with SecurityPermissionSet

use of org.apache.ignite.plugin.security.SecurityPermissionSet in project ignite by apache.

the class CacheOperationPermissionCreateDestroyCheckTest method testCreateCacheWithSystemPermissions.

/**
 */
@Test
public void testCreateCacheWithSystemPermissions() throws Exception {
    SecurityPermissionSet secPermSet = builder().appendSystemPermissions(CACHE_CREATE).build();
    try (Ignite node = startGrid(TEST_NODE, secPermSet, clientMode)) {
        assertThrowsWithCause(() -> forbidden(clientMode).createCache(CACHE_NAME), SecurityException.class);
        assertNotNull(node.createCache(CACHE_NAME));
    }
}
Also used : SecurityPermissionSet(org.apache.ignite.plugin.security.SecurityPermissionSet) Ignite(org.apache.ignite.Ignite) Test(org.junit.Test) AbstractSecurityTest(org.apache.ignite.internal.processors.security.AbstractSecurityTest)

Aggregations

SecurityPermissionSet (org.apache.ignite.plugin.security.SecurityPermissionSet)6 AbstractSecurityTest (org.apache.ignite.internal.processors.security.AbstractSecurityTest)5 Ignite (org.apache.ignite.Ignite)4 Test (org.junit.Test)4 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 LineNumberReader (java.io.LineNumberReader)1 URL (java.net.URL)1 URLConnection (java.net.URLConnection)1 UTF_8 (java.nio.charset.StandardCharsets.UTF_8)1 Permissions (java.security.Permissions)1 Collection (java.util.Collection)1 Collections.singletonMap (java.util.Collections.singletonMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 Collectors (java.util.stream.Collectors)1 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 IgniteException (org.apache.ignite.IgniteException)1