Package java.security

Examples of java.security.Permissions


        }
        PermissionCollection permissionsOfRole = rolePermissions.get(roleName);

        // create permission object if no previous permission for the given role
        if (permissionsOfRole == null) {
            permissionsOfRole = new Permissions();
        }

        for (Enumeration e = permissions.elements(); e.hasMoreElements();) {
            permissionsOfRole.add((Permission) e.nextElement());
        }
View Full Code Here


        // Section 3.3 - Check permissions
        checkSetPolicy();

        // all policy statements are deleted
        excludedPermissions = new Permissions();
        uncheckedPermissions = new Permissions();
        rolePermissions = new HashMap<String, PermissionCollection>();

        // change state to DELETED
        state = State.DELETED;
View Full Code Here

        // Open state required
        checkCurrentStateIsInState(State.OPEN);

        // reinit
        excludedPermissions = new Permissions();
    }
View Full Code Here

     * @return the excluded permission
     */
    public PermissionCollection getExcludedPermissions() {
        // Works only if state is in service
        if (state != State.IN_SERVICE) {
            return new Permissions();
        }
        return excludedPermissions;
    }
View Full Code Here

     * @return the excluded permission
     */
    public PermissionCollection getUncheckedPermissions() {
        // Works only if state is in service
        if (state != State.IN_SERVICE) {
            return new Permissions();
        }
        return uncheckedPermissions;
    }
View Full Code Here

        logger.debug("principal = ''{0}''", principal);

        // Works only if state is in service and if principal is not null
        if (principal == null || state != State.IN_SERVICE) {
            return new Permissions();
        }

        PermissionCollection permissionsOfRole = rolePermissions.get(principal.getName());

        logger.debug("Permissions found = ''{0}''", permissionsOfRole);

        // create empty permission object if no previous permission for the
        // given role
        if (permissionsOfRole == null) {
            permissionsOfRole = new Permissions();
        }

        return permissionsOfRole;
    }
View Full Code Here

         addToExcludedPolicy(en.nextElement());
   }

   public void addToRole(String roleName, Permission permission) throws PolicyContextException
   {
      Permissions p = rolePerms.get(roleName);
      if(p == null)
         p = new Permissions();
      p.add(permission);
      rolePerms.put(roleName, p);
   }
View Full Code Here

      this.excludedPolicy = null;
   }

   public void removeRole(String roleName) throws PolicyContextException
   {
      Permissions p = this.rolePerms.get(roleName);
      if(p != null)
      {
         p = null;
         rolePerms.remove(roleName);
      }  
View Full Code Here

      }
      else
     
         try
         {
            Permissions perms = this.getPermissionsForRole("*");
            if(perms != null)
               implied = perms.implies(new WebResourcePermission("/*",(String)null));
         }
         catch (PolicyContextException e)
         {
            throw new RuntimeException(e);
        
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

TOP

Related Classes of java.security.Permissions

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.