use of java.util.PropertyPermission in project wildfly by wildfly.
the class RunAsEjbMdbTestCase method runAsEJB3.
@Deployment(testable = false, managed = true, name = "ejb3", order = 2)
public static Archive<?> runAsEJB3() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "runasmdbejb-ejb3.jar").addClasses(HelloBean.class, Hello.class, HolaBean.class, Hola.class, Howdy.class, HowdyBean.class, HelloMDB.class, TimeoutUtil.class);
// TODO WFLY-15289 Should these permissions be required?
jar.addAsResource(createPermissionsXmlAsset(new PropertyPermission("ts.timeout.factor", "read"), new ElytronPermission("setRunAsPrincipal"), new ElytronPermission("handleSecurityEvent"), new ChangeRoleMapperPermission("ejb")), "META-INF/jboss-permissions.xml");
jar.addAsManifestResource(new StringAsset("Dependencies: deployment.runasmdbejb-ejb2.jar \n"), "MANIFEST.MF");
return jar;
}
use of java.util.PropertyPermission in project wildfly by wildfly.
the class MDBWhichDependsOnTestCase method getMDBArchive.
@Deployment(name = Constants.DEPLOYMENT_NAME_MDB, order = 1, managed = false, testable = false)
public static Archive getMDBArchive() {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, Constants.DEPLOYMENT_JAR_NAME_MDB);
jar.addPackage(JMSOperations.class.getPackage());
jar.addClasses(JMSMessagingUtil.class, TimeoutUtil.class);
jar.addClass(MDBWhichDependsOn.class);
jar.addClass(Constants.class);
jar.addClass(CallCounterProxy.class);
jar.addAsManifestResource(new StringAsset("Dependencies: org.jboss.as.controller-client, org.jboss.dmr, " + Constants.TEST_MODULE_NAME_FULL + "\n"), "MANIFEST.MF");
jar.addAsManifestResource(createPermissionsXmlAsset(new PropertyPermission(TimeoutUtil.FACTOR_SYS_PROP, "read")), "permissions.xml");
return jar;
}
use of java.util.PropertyPermission in project wildfly by wildfly.
the class AbstractDatasourceCapacityPoliciesTestCase method createDeployment.
@Deployment
public static Archive<?> createDeployment() {
JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "jca-capacity-test.jar");
jar.addClasses(JcaMgmtBase.class, ManagementOperations.class, ContainerResourceMgmtTestBase.class, AbstractMgmtTestBase.class, JcaMgmtServerSetupTask.class, MgmtOperationException.class, AbstractDatasourceCapacityPoliciesTestCase.class, DatasourceCapacityPoliciesTestCase.class, JcaTestsUtil.class, TimeoutUtil.class);
jar.addAsManifestResource(new StringAsset("Dependencies: javax.inject.api,org.jboss.as.connector," + "org.jboss.as.controller,org.jboss.dmr,org.jboss.staxmapper," + "org.jboss.ironjacamar.impl, org.jboss.ironjacamar.jdbcadapters,org.jboss.remoting\n"), "MANIFEST.MF");
jar.addAsManifestResource(createPermissionsXmlAsset(new RemotingPermission("createEndpoint"), new RemotingPermission("connect"), new FilePermission(System.getProperty("jboss.inst") + "/standalone/tmp/auth/*", "read"), new PropertyPermission("ts.timeout.factor", "read"), new RuntimePermission("accessDeclaredMembers"), new ReflectPermission("suppressAccessChecks")), "permissions.xml");
return jar;
}
use of java.util.PropertyPermission in project keycloak by keycloak.
the class SecurityActions method setSystemProperty.
/**
* Set the system property
*
* @param key
* @param defaultValue
*
* @return
*/
public static void setSystemProperty(final String key, final String value) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(new PropertyPermission(key, "write"));
AccessController.doPrivileged(new PrivilegedAction<Object>() {
@Override
public Object run() {
System.setProperty(key, value);
return null;
}
});
} else {
System.setProperty(key, value);
}
}
Aggregations