Package java.security

Examples of java.security.AllPermission


  public void checkReadWritePermission(UriRef tripleCollectionUri) {
    SecurityManager security = System.getSecurityManager();
    if (security != null) {
      //will AllPermissions the rest is obsolete
      try {
        AccessController.checkPermission(new AllPermission());
      } catch (AccessControlException e) {
        if (tripleCollectionUri.equals(permissionGraphName)) {
          AccessController.checkPermission(new TcPermission(
              tripleCollectionUri.getUnicodeString(), TcPermission.READWRITE));
        } else {
View Full Code Here


    Policy.setPolicy(new Policy() {

      @Override
      public PermissionCollection getPermissions(ProtectionDomain domain) {
        PermissionCollection result = new Permissions();
        result.add(new AllPermission());
        return result;
      }
    });
    System.setSecurityManager(new SecurityManager());
    felixInstance = new Felix(configProps);
View Full Code Here

        PermissionParser.getPermission(
        "(java.io.FilePermission \"/\" \"read\")"));
    Assert.assertEquals(filePermission,
        PermissionParser.getPermission(
        filePermission.toString()));
    Assert.assertEquals(new AllPermission(),
        PermissionParser.getPermission(
        "(java.security.AllPermission)"));
    Assert.assertEquals(new AllPermission(),
        PermissionParser.getPermission(
        "(java.security.AllPermission \"\")"));
    Assert.assertEquals(new AllPermission(),
        PermissionParser.getPermission(
        "(java.security.AllPermission \"\" \"\")"));
  }
View Full Code Here

    URL agentImplLib = findAgentImplLib();
    URLClassLoader agentImplLoader = new URLClassLoader(new URL[] {agentImplLib}) {
      @Override
      protected PermissionCollection getPermissions(CodeSource codesource) {
        PermissionCollection perms = super.getPermissions(codesource);
        perms.add(new AllPermission());
        return perms;
      }
    };
    try {
      Class<?> implClass = agentImplLoader.loadClass(AGENT_IMPL);
View Full Code Here

  @Override
  protected PermissionCollection getPermissions(CodeSource codesource) {
    PermissionCollection permissions = super.getPermissions(codesource);
    if (agentRuntimeLibs.contains(codesource.getLocation())) {
      permissions.add(new AllPermission());
    } else {
      addAllPermissions(appPermissions, permissions);
    }
    return permissions;
  }
View Full Code Here

      addAllPermissions(
          buildPermissionsToAccessAppFiles(externalResourceDir, allowWriteAccess), permissions);
    }

    if (Boolean.valueOf(System.getProperty("--enable_all_permissions"))) {
      permissions.add(new AllPermission());
      return permissions;
    }

    permissions.add(new RuntimePermission("getClassLoader"));
    permissions.add(new RuntimePermission("setContextClassLoader"));
View Full Code Here

    @Override
    protected PermissionCollection getPermissions(CodeSource codesource) {
        // Grant all perission. This could be avoided if code signers were
        // extracted correctly.
        Permissions permissions = new Permissions();
        AllPermission permission = new AllPermission();
        permissions.add(permission);
        return permissions;
    }
View Full Code Here

     * The only exception is UnresolvedPermission itself, which is effectively
     * implied only by AllPermission
     */
    public void testImplies() {
        Permissions ps = new Permissions();
        Permission ap = new AllPermission();
        Permission bp1 = new BasicPermission("jhb23jhg5") {
        };
        Permission bp2 = new BasicPermission("&%#&^$HJVH") {

            public PermissionCollection newPermissionCollection() {
View Full Code Here

        assertFalse(policy.implies(null, null));
       
        ProtectionDomain pd = new ProtectionDomain(null, policy.pc);
        policy.pc = null;
        assertTrue(policy.implies(pd, sp));       
        assertFalse(policy.implies(pd, new AllPermission()));
    }
View Full Code Here

     * Returns array containing empty and non-empty Permissions.
     */
    protected Object[] getData() {
        Permissions ps = new Permissions();

        ps.add(new AllPermission());
        ps.add(new SecurityPermission("abc"));

        return new Object[] { new Permissions(), ps };
    }
View Full Code Here

TOP

Related Classes of java.security.AllPermission

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.