Examples of implies()


Examples of java.security.CodeSource.implies()

    protected void addPermissions(CodeSource codeSource,
                                  PermissionCollection perms) {
        for (Map.Entry<CodeSource, PermissionCollection> e : codeSource2Permissions
            .entrySet()) {
            final CodeSource cs = e.getKey();
            if (cs.implies(codeSource)) {
                // BootLogInstance.get().info(cs + " -> " + codeSource);
                final PermissionCollection pc = e.getValue();
                for (Enumeration<?> ee = pc.elements(); ee.hasMoreElements();) {
                    perms.add((Permission) ee.nextElement());
                }
View Full Code Here

Examples of java.security.Permission.implies()

        // The argument is an instanceof WebResourcePermission
        Permission pA = new WebResourcePermission("/foo", "");
        Permission pB = new WebUserDataPermission("/foo", "");
       
        assertFalse(pA.implies(pB));
        assertFalse(pB.implies(pA));
   
        pA = new WebResourcePermission("/foo", "");
        pB = new WebResourcePermission("/foo", "GET,POST");
       
        assertTrue(pA.implies(pB));
View Full Code Here

Examples of java.security.Permission.implies()

   
        pA = new WebResourcePermission("/foo", "");
        pB = new WebResourcePermission("/foo", "GET,POST");
       
        assertTrue(pA.implies(pB));
        assertFalse(pB.implies(pA));
       
        pA = new WebResourcePermission("/foo/*:/foo/bar", "");
        pB = new WebResourcePermission("/foo/bar", "");
       
        assertFalse(pA.implies(pB));
View Full Code Here

Examples of java.security.Permission.implies()

       
        pA = new WebResourcePermission("/foo/*:/foo/bar", "");
        pB = new WebResourcePermission("/foo/bar", "");
       
        assertFalse(pA.implies(pB));
        assertFalse(pB.implies(pA));

        pA = new WebResourcePermission("/foo/bar/*:/foo/bar/cat/dog", "");
        pB = new WebResourcePermission("/foo/bar/*:/foo/bar/cat/*", "");

        assertTrue(pA.implies(pB));
View Full Code Here

Examples of java.security.Permission.implies()

        pA = new WebResourcePermission("/foo/bar/*:/foo/bar/cat/dog", "");
        pB = new WebResourcePermission("/foo/bar/*:/foo/bar/cat/*", "");

        assertTrue(pA.implies(pB));
        assertFalse(pB.implies(pA));

        pA = new WebResourcePermission("/:/a.jsp:/b.jsp:/c.jsp", "GET,POST,PUT,DELETE,HEAD,OPTIONS,TRACE");
        pB = new WebResourcePermission("/:/a.jsp:/c.jsp:/b.jsp", (String) null);

        assertTrue(pA.implies(pB));
View Full Code Here

Examples of java.security.Permission.implies()

        pA = new WebResourcePermission("/:/a.jsp:/b.jsp:/c.jsp", "GET,POST,PUT,DELETE,HEAD,OPTIONS,TRACE");
        pB = new WebResourcePermission("/:/a.jsp:/c.jsp:/b.jsp", (String) null);

        assertTrue(pA.implies(pB));
        assertTrue(pB.implies(pA));
    }

    /*
     * Testing WebResourcePermission(String, String[])
     */
 
View Full Code Here

Examples of java.security.PermissionCollection.implies()

            FilePermission fp = new FilePermission( root, "read" );
            rootDirectory = fp.newPermissionCollection();
            rootDirectory.add( fp );
            rootDirectory.add( new FilePermission( root + File.separator + "-", "read" ) );
        }
        return ( rootDirectory.implies( new FilePermission( file.getCanonicalPath(), "read" ) ) );
    }

    /**
     * This method tries to find a suitable InetAddress that is routable.  It calls {@link java.net.InetAddress#getLocalHost}
     * to find the local host.  If that address it a site local address (192.168.*.*, 10.*.*.*, or 172.16.*.*) or the
View Full Code Here

Examples of java.security.PermissionCollection.implies()

        // excluded ?
        if (excludedPermissions.implies(permission)) {
            logger.debug("Permission ''{0}'' is excluded, return false", permission);
            return false;
        } else if (uncheckedPermissions.implies(permission)) { // unchecked
            logger.debug("Permission ''{0}'' is unchecked, return true", permission);
            return true;
        } else {
            // per role if any or false
            if (domain.getPrincipals().length > 0) {
View Full Code Here

Examples of java.security.PermissionCollection.implies()

                logger.debug("Checking permission ''{0}'' with permissions of Principal ''{1}''.", permission, principals[i]
                        .getName());
            }
            permissions = jPolicyConfiguration.getPermissionsForPrincipal(principals[i]);

            if (permissions.implies(permission)) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Permission implied with principal ''{0}''.", principals[i].getName());
                }
                implied = true;
            }
View Full Code Here

Examples of java.security.PermissionCollection.implies()

 
  public final boolean checkPermission(Permission perm)
  {
    PermissionCollection perms = getCombinedPermissions();
    if (perms != null) {
      if (perms.implies(perm)) {
        return true;
      }
    }
    return false;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.