Example usage for java.util PropertyPermission PropertyPermission

List of usage examples for java.util PropertyPermission PropertyPermission

Introduction

In this page you can find the example usage for java.util PropertyPermission PropertyPermission.

Prototype

PropertyPermission(String name, int mask) 

Source Link

Document

Creates a PropertyPermission object with the specified name and a pre-calculated mask.

Usage

From source file:org.jboss.as.test.integration.security.loginmodules.negotiation.SPNEGOLoginModuleTestCase.java

/**
 * Creates {@link WebArchive}./*w  w w  . j a  v a2  s. c  o m*/
 *
 * @return
 */
@Deployment(name = "WEB", testable = false)
public static WebArchive deployment() {
    LOGGER.debug("Web deployment");
    final WebArchive war = createWebApp(WEBAPP_NAME, "web-spnego-authn.xml", "SPNEGO");
    war.addAsManifestResource(PermissionUtils.createPermissionsXmlAsset(
            // Permissions for PropagateIdentityServlet to get delegation credentials DelegationCredentialContext.getDelegCredential()
            new RuntimePermission("org.jboss.security.negotiation.getDelegCredential"),
            // Permissions for PropagateIdentityServlet to read properties
            new PropertyPermission(GSSTestConstants.PROPERTY_PORT, "read"),
            new PropertyPermission(GSSTestConstants.PROPERTY_PRINCIPAL, "read"),
            new PropertyPermission(GSSTestConstants.PROPERTY_PASSWORD, "read"),
            // Permissions for GSSTestClient to connect to GSSTestServer
            new SocketPermission(TestSuiteEnvironment.getServerAddress(), "resolve,connect"),
            new SocketPermission(CoreUtils.getCannonicalHost(TestSuiteEnvironment.getServerAddress()),
                    "resolve,connect"),
            // Permissions for GSSTestClient to initiate gss context
            new ServicePermission(GSSTestConstants.PRINCIPAL, "initiate"),
            new ServicePermission("krbtgt/JBOSS.ORG@JBOSS.ORG", "initiate")), "permissions.xml");
    return war;
}