Package java.security

Examples of java.security.Permissions$PermissionsHash


    }

    protected void addPermissionToRole(String roleName, Permission permission, Map<String, PermissionCollection> rolePermissions) {
        PermissionCollection permissionsForRole = rolePermissions.get(roleName);
        if (permissionsForRole == null) {
            permissionsForRole = new Permissions();
            rolePermissions.put(roleName, permissionsForRole);
        }
        permissionsForRole.add(permission);
    }
View Full Code Here


    * @return none class ivar
    */
   protected PermissionCollection noPermissions()
   {
      if (none == null)
         none = new Permissions();
      return none;
   }
View Full Code Here

    */
   protected PermissionCollection fileReadPermissions()
   {
      if (fileRead == null)
      {
         fileRead = new Permissions();
         fileRead.add(new FilePermission("<<ALL FILES>>", "read"));
      }
      return fileRead;
   }
View Full Code Here

    */
   protected PermissionCollection allPermissions()
   {
      if (all == null)
      {
         all = new Permissions();
         all.add(new AllPermission());
      }
      return all;
   }
View Full Code Here

public class simple implements Testlet
{
  public void test(TestHarness harness)
  {
    // Test for a classpath regression.
    Permissions p = new Permissions();
    // (The following used to use the bogus action "nothing" ... but
    // the JDK 1.4.2 javadoc makes it clear that only actions "read",
    // "write", "execute" and "delete" are recognized.  And the JDK
    // 1.4.2 implementation throws IllegalArgumentException for an
    // unrecognized action.)
    p.add(new FilePermission("/tmp/p", "read"));
    p.add(new FilePermission("/tmp/p", "read"));

    // Classpath didn't handle dirs without a file separator correctly
    FilePermission fp1 = new FilePermission("/tmp", "read");
    harness.check(fp1.implies(fp1));
View Full Code Here

        (subject,
        null,
        codesource == null ? null : codesource.getLocation(),
        codesource == null ? null : codesource.getCertificates());
     if (initialized)
         return getPermissions(new Permissions(), scs);
     else
        return new PolicyPermissions(PolicyFile.this, scs);
      }
  });
    }
View Full Code Here

     * @return the set of permissions according to the policy. 
     */
    PermissionCollection getPermissions(CodeSource codesource) {

   if (initialized)
       return getPermissions(new Permissions(), codesource);
   else
       return new PolicyPermissions(this, codesource);
    }
View Full Code Here

    }

    private synchronized void init() {
  if (notInit) {
      if (perms == null)
    perms = new Permissions();

      if (additionalPerms != null) {
    Enumeration e = additionalPerms.elements();
    while (e.hasMoreElements()) {
        perms.add((Permission)e.nextElement());
View Full Code Here

            if (parentLayer == null)
            {
                return super.getPermissions(cs);
            }

            Permissions combi = new Permissions();
            PermissionCollection permCollect = super.getPermissions(cs);
            copyPermissions(permCollect, combi);

            for (FileObject parent = parentLayer;
                 parent != null;
View Full Code Here

        SubjectInfo defaultSubjectInfo = new SubjectInfo(securityRealmName, defaultPrincipalId);

        Map<String, SubjectInfo> roleDesignates = Collections.emptyMap();
        Map<Principal, Set<String>> principalRoleMap = Collections.singletonMap((Principal)new GeronimoGroupPrincipal("it"), Collections.singleton("content-administrator"));

        PermissionCollection uncheckedPermissions = new Permissions();
        uncheckedPermissions.add(new WebUserDataPermission("/protected/*", ""));

        PermissionCollection excludedPermissions = new Permissions();
        uncheckedPermissions.add(new WebResourcePermission("/auth/logon.html", ""));
        uncheckedPermissions.add(new WebUserDataPermission("/auth/logon.html", ""));
//        uncheckedPermissions.add(new WebResourcePermission("/auth/j_security_check", ""));
        uncheckedPermissions.add(new WebUserDataPermission("/auth/j_security_check", ""));

        Map<String, PermissionCollection> rolePermissions = new HashMap<String, PermissionCollection>();
        PermissionCollection permissions = new Permissions();
        permissions.add(new WebResourcePermission("/protected/*", ""));
        rolePermissions.put("content-administrator", permissions);
        rolePermissions.put("auto-administrator", permissions);

        Set<String> securityRoles = new HashSet<String>();
        securityRoles.add("content-administrator");
View Full Code Here

TOP

Related Classes of java.security.Permissions$PermissionsHash

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.