Package java.security

Examples of java.security.PermissionCollection.elements()


                ComponentPermissions componentPermissions = buildSpecSecurityConfig(webApp, securityRoles, rolePermissions);
                webModuleData.setAttribute("excludedPermissions", componentPermissions.getExcludedPermissions());
                PermissionCollection checkedPermissions = new Permissions();
                for (Iterator iterator = rolePermissions.values().iterator(); iterator.hasNext();) {
                    PermissionCollection permissionsForRole = (PermissionCollection) iterator.next();
                    for (Enumeration iterator2 = permissionsForRole.elements(); iterator2.hasMoreElements();) {
                        Permission permission = (Permission) iterator2.nextElement();
                        checkedPermissions.add(permission);
                    }
                }
                webModuleData.setAttribute("checkedPermissions", checkedPermissions);
View Full Code Here


                ComponentPermissions componentPermissions = buildSpecSecurityConfig(webApp, securityRoles, rolePermissions);
                securityHolder.setExcluded(componentPermissions.getExcludedPermissions());
                PermissionCollection checkedPermissions = new Permissions();
                for (Iterator iterator = rolePermissions.values().iterator(); iterator.hasNext();) {
                    PermissionCollection permissionsForRole = (PermissionCollection) iterator.next();
                    for (Enumeration iterator2 = permissionsForRole.elements(); iterator2.hasMoreElements();) {
                        Permission permission = (Permission) iterator2.nextElement();
                        checkedPermissions.add(permission);
                    }
                }
                securityHolder.setChecked(checkedPermissions);
View Full Code Here

        ComponentPermissions componentPermissions = buildSpecSecurityConfig(webApp, securityRoles, rolePermissions);
        webModuleData.setAttribute("excludedPermissions", componentPermissions.getExcludedPermissions());
        PermissionCollection checkedPermissions = new Permissions();
        for (Iterator iterator = rolePermissions.values().iterator(); iterator.hasNext();) {
            PermissionCollection permissionsForRole = (PermissionCollection) iterator.next();
            for (Enumeration iterator2 = permissionsForRole.elements(); iterator2.hasMoreElements();) {
                Permission permission = (Permission) iterator2.nextElement();
                checkedPermissions.add(permission);
            }
        }
        webModuleData.setAttribute("checkedPermissions", checkedPermissions);
View Full Code Here

    }

    public Permission getPermission(Principal prpal, Class permClass, String permName) {
        PermissionCollection permCollection = getPermissions(prpal);
        if (permCollection != null) {
            Enumeration en = permCollection.elements();
            while (en.hasMoreElements()) {
                Permission perm = (Permission)en.nextElement();
                if (perm.getName().equals(permName) && perm.getClass().getName().equals(permClass.getName())) {
                    return perm;
                }
View Full Code Here

        if (documentCodeSource != null){
            PermissionCollection urlPC
                = super.getPermissions(documentCodeSource);

            if (pc != null) {
                Enumeration items = urlPC.elements();
                while (items.hasMoreElements()) {
                    pc.add((Permission)(items.nextElement()));
                }
            } else {
                pc = urlPC;
View Full Code Here

            .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

    // XXX end of classpath-specific code

    LinkedList jars = new LinkedList();
    for (int i = 0; i < domains.length; i++) {
      PermissionCollection perms = domains[i].getPermissions();
      for (Enumeration e = perms.elements(); e.hasMoreElements() ;) {
  Permission p = (Permission) e.nextElement();
  if (!(p instanceof FilePermission))
    continue;
  String path = p.getName();
  if (path.length() == base.length() + 5
View Full Code Here

   public PermissionCollection getPermissions(ProtectionDomain domain)
   {
      PermissionCollection pc = super.getPermissions(domain);
      PermissionCollection delegated = delegate.getPermissions(domain);
      for (Enumeration e = delegated.elements(); e.hasMoreElements();)
      {
         Permission p = (Permission) e.nextElement();
         pc.add(p);
      }
      return pc;
View Full Code Here

        if (pReturned == null) {
            throw new TestException(Util.fail(msg, SNULL, "not a " + SNULL));
        }

        if (pReturned.elements().hasMoreElements()) {
            String ret = "Collection that contains an element(s)";
            String exp = "Collection that that does not contain any element";
            throw new TestException(Util.fail(msg, ret, exp));
        }
        logger.log(Level.FINE, Util.pass(msg, "passed"));
View Full Code Here

                         + "  expected: throws SecurityException";

                // Fast fail approach
                throw new TestException(message);
            }
            Enumeration permissions = pc.elements();

            while (permissions.hasMoreElements()) {
                Permission p = (Permission) permissions.nextElement();
                logger.log(Level.FINE, "Permission: " + p.toString());
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.