Search in sources :

Example 86 with Permission

use of java.security.Permission in project hazelcast by hazelcast.

the class ActionConstantsTest method getPermission_AtomicLong.

@Test
public void getPermission_AtomicLong() {
    Permission permission = ActionConstants.getPermission("foo", AtomicLongService.SERVICE_NAME);
    assertNotNull(permission);
    assertTrue(permission instanceof AtomicLongPermission);
}
Also used : Permission(java.security.Permission) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 87 with Permission

use of java.security.Permission in project hazelcast by hazelcast.

the class ActionConstantsTest method getPermission_Topic.

@Test
public void getPermission_Topic() {
    Permission permission = ActionConstants.getPermission("foo", TopicService.SERVICE_NAME);
    assertNotNull(permission);
    assertTrue(permission instanceof TopicPermission);
}
Also used : Permission(java.security.Permission) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 88 with Permission

use of java.security.Permission in project hazelcast by hazelcast.

the class ActionConstantsTest method getPermission_Cache.

@Test
public void getPermission_Cache() {
    Permission permission = ActionConstants.getPermission("foo", ICacheService.SERVICE_NAME);
    assertNotNull(permission);
    assertTrue(permission instanceof CachePermission);
}
Also used : Permission(java.security.Permission) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 89 with Permission

use of java.security.Permission in project hazelcast by hazelcast.

the class ActionConstantsTest method getPermission_ReplicatedMap.

@Test
public void getPermission_ReplicatedMap() {
    Permission permission = ActionConstants.getPermission("foo", ReplicatedMapService.SERVICE_NAME);
    assertNotNull(permission);
    assertTrue(permission instanceof ReplicatedMapPermission);
}
Also used : Permission(java.security.Permission) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 90 with Permission

use of java.security.Permission in project j2objc by google.

the class HttpURLConnection method getPermission.

/**
 * Returns a {@link SocketPermission} object representing the
 * permission necessary to connect to the destination host and port.
 *
 * @exception IOException if an error occurs while computing
 *            the permission.
 *
 * @return a {@code SocketPermission} object representing the
 *         permission necessary to connect to the destination
 *         host and port.
 */
public Permission getPermission() throws IOException {
    int port = url.getPort();
    port = port < 0 ? 80 : port;
    String host = url.getHost() + ":" + port;
    Permission permission = new SocketPermission(host, "connect");
    return permission;
}
Also used : Permission(java.security.Permission)

Aggregations

Permission (java.security.Permission)236 Test (org.junit.Test)55 PermissionCollection (java.security.PermissionCollection)39 FilePermission (java.io.FilePermission)38 Permissions (java.security.Permissions)31 ProtectionDomain (java.security.ProtectionDomain)27 IOException (java.io.IOException)20 AllPermission (java.security.AllPermission)20 QuickTest (com.hazelcast.test.annotation.QuickTest)17 File (java.io.File)17 URL (java.net.URL)16 AccessControlException (java.security.AccessControlException)14 Principal (java.security.Principal)14 PropertyPermission (java.util.PropertyPermission)14 Policy (java.security.Policy)13 MBeanPermission (javax.management.MBeanPermission)13 AccessControlContext (java.security.AccessControlContext)12 CodeSource (java.security.CodeSource)11 SecurityPermission (java.security.SecurityPermission)11 ArrayList (java.util.ArrayList)10