use of java.util.PropertyPermission in project wildfly by wildfly.
the class RemoteFailoverTestCase method createDeployment.
private static Archive<?> createDeployment() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
jar.addPackage(Incrementor.class.getPackage());
jar.addPackage(EJBDirectory.class.getPackage());
jar.setManifest(new StringAsset("Manifest-Version: 1.0\nDependencies: org.infinispan\n"));
jar.addAsManifestResource(createPermissionsXmlAsset(new PropertyPermission(NODE_NAME_PROPERTY, "read")), "permissions.xml");
return jar;
}
use of java.util.PropertyPermission in project wildfly by wildfly.
the class RegistryTestCase method createDeployment.
private static Archive<?> createDeployment() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, MODULE_NAME + ".jar");
jar.addPackage(RegistryRetriever.class.getPackage());
jar.addAsManifestResource(createPermissionsXmlAsset(new PropertyPermission(NODE_NAME_PROPERTY, "read")), "permissions.xml");
return jar;
}
use of java.util.PropertyPermission in project jdk8u_jdk by JetBrains.
the class MyBasicPermission method tryPropPC.
static void tryPropPC() throws Exception {
try {
PropertyPermission p0 = new PropertyPermission("user.home", "read");
PermissionCollection pc = p0.newPermissionCollection();
// this should lock out future adds
pc.setReadOnly();
//
PropertyPermission p1 = new PropertyPermission("java.home", "read");
pc.add(p1);
throw new Exception("Failed...PropertyPermission added to readonly PropertyPermissionCollection.");
} catch (SecurityException se) {
System.out.println("PropertyPermissionCollection passed");
}
}
use of java.util.PropertyPermission in project jdk8u_jdk by JetBrains.
the class TestPolicy method setMinimalPermissions.
/*
* Defines the minimal permissions required by testNG when running these
* tests
*/
private void setMinimalPermissions() {
permissions.add(new SecurityPermission("getPolicy"));
permissions.add(new SecurityPermission("setPolicy"));
permissions.add(new RuntimePermission("getClassLoader"));
permissions.add(new RuntimePermission("setSecurityManager"));
permissions.add(new RuntimePermission("createSecurityManager"));
permissions.add(new PropertyPermission("testng.show.stack.frames", "read"));
permissions.add(new PropertyPermission("line.separator", "read"));
permissions.add(new PropertyPermission("fileStringBuffer", "read"));
permissions.add(new PropertyPermission("dataproviderthreadcount", "read"));
permissions.add(new PropertyPermission("java.io.tmpdir", "read"));
permissions.add(new FilePermission("<<ALL FILES>>", "read, write, delete"));
}
use of java.util.PropertyPermission in project jdk8u_jdk by JetBrains.
the class WildcardPrincipalName method main.
public static void main(String[] args) throws Exception {
X500Principal duke = new X500Principal("CN=Duke");
PropertyPermission pp = new PropertyPermission("user.home", "read");
RunAsPrivilegedUserAction runAsPrivilegedUserAction = new RunAsPrivilegedUserAction(duke, new CheckPermissionAction(pp));
AccessController.doPrivileged(runAsPrivilegedUserAction);
System.out.println("test PASSED");
}
Aggregations