Package org.apache.jetspeed.om.registry

Examples of org.apache.jetspeed.om.registry.SecurityAccess


                    }
                       
                    Iterator deleteIter = deleteList.iterator();
                    while(deleteIter.hasNext())
                    {
                      SecurityAccess sa = (SecurityAccess)deleteIter.next();
                      securityEntry.getAccesses().remove(sa);
                    }
                    
                    Registry.addEntry(Registry.SECURITY, securityEntry);
                    clearUserData(rundata);
View Full Code Here


    SecurityEntry secEntry = (SecurityEntry) Registry.getEntry( Registry.SECURITY, "powerusers_all-anon_view");
    Vector accessVector = secEntry.getAccesses();
   
    for (Iterator it = accessVector.iterator(); it.hasNext();)
    {
      SecurityAccess access = (SecurityAccess) it.next();
      System.out.println("Action:" + access.getAction().toString());
     
      Vector allAllows = access.getAllAllows();
      for (Iterator it1 = allAllows.iterator(); it1.hasNext();)
      {
        SecurityAllow allow = (SecurityAllow) it1.next();
        System.out.println("Allow group: " + allow.getGroup() + ", role: " + allow.getRole() + ", user: " + allow.getUser());       
      }
View Full Code Here

        if (object == null || !(object instanceof SecurityAccess))
        {
            return false;
        }

        SecurityAccess obj = (SecurityAccess) object;

        if (action != null)
        {
            if (!action.equals(obj.getAction()))
            {
                return false;
            }
        }
        else
        {
            if (obj.getAction() != null)
            {
                return false;
            }
        }

        Iterator i = allows.iterator();
        Iterator i2 = obj.getAllows().iterator();
        while (i.hasNext())
        {
            SecurityAllow c1 = (SecurityAllow) i.next();
            SecurityAllow c2 = null;

            if (i2.hasNext())
            {
                c2 = (SecurityAllow) i2.next();
            }
            else
            {
                return false;
            }

            if (!c1.equals(c2))
            {
                return false;
            }
        }

        if (i2.hasNext())
        {
            return false;
        }

        i = ownerAllows.iterator();
        i2 = obj.getOwnerAllows().iterator();
        while (i.hasNext())
        {
            BaseSecurityAllowOwner c1 = (BaseSecurityAllowOwner) i.next();
            BaseSecurityAllowOwner c2 = null;
View Full Code Here

                    Vector accesses = securityEntry.getAccesses();
                    Iterator deleteIter = deleteList.iterator();
                    while (deleteIter.hasNext())
                    {
                        SecurityAccess sa = (SecurityAccess) deleteIter.next();
                        accesses.remove(sa);
                    }
                   
                    securityEntry.setAccesses(accesses);
View Full Code Here

    SecurityEntry secEntry = (SecurityEntry) Registry.getEntry( Registry.SECURITY, "powerusers_all-anon_view");
    Vector accessVector = secEntry.getAccesses();
   
    for (Iterator it = accessVector.iterator(); it.hasNext();)
    {
      SecurityAccess access = (SecurityAccess) it.next();
      System.out.println("Action:" + access.getAction().toString());
     
      Vector allAllows = access.getAllAllows();
      for (Iterator it1 = allAllows.iterator(); it1.hasNext();)
      {
        SecurityAllow allow = (SecurityAllow) it1.next();
        System.out.println("Allow group: " + allow.getGroup() + ", role: " + allow.getRole() + ", user: " + allow.getUser());       
      }
View Full Code Here

        if (object == null || !(object instanceof SecurityAccess))
        {
            return false;
        }

        SecurityAccess obj = (SecurityAccess) object;

        if (action != null)
        {
            if (!action.equals(obj.getAction()))
            {
                return false;
            }
        }
        else
        {
            if (obj.getAction() != null)
            {
                return false;
            }
        }

        Iterator i = allows.iterator();
        Iterator i2 = obj.getAllows().iterator();
        while (i.hasNext())
        {
            SecurityAllow c1 = (SecurityAllow) i.next();
            SecurityAllow c2 = null;

            if (i2.hasNext())
            {
                c2 = (SecurityAllow) i2.next();
            }
            else
            {
                return false;
            }

            if (!c1.equals(c2))
            {
                return false;
            }
        }

        if (i2.hasNext())
        {
            return false;
        }

        i = ownerAllows.iterator();
        i2 = obj.getOwnerAllows().iterator();
        while (i.hasNext())
        {
            BaseSecurityAllowOwner c1 = (BaseSecurityAllowOwner) i.next();
            BaseSecurityAllowOwner c2 = null;
View Full Code Here

     * Checks whether a role is specifically allowed to access the request action
     * This method ignores the "*" action and is here to play a maintenance role.
     */
    public boolean allowsSpecificRole( String action, String role)
    {
        SecurityAccess access = (SecurityAccess) getAccess(action);
        if (access.getAllAllows() != null)
        {
            Iterator allAllows = access.getAllows().iterator();
            while (allAllows.hasNext())
            {
                SecurityAllow allow = (SecurityAllow) allAllows.next();
                if (allow.getRole() != null && allow.getRole().equals(role))
                {
View Full Code Here

   * Checks whether a group is specifically allowed to access the request action
   * This method ignores the "*" action and is here to play a maintenance role.
   */
  public boolean allowsSpecificGroup(String action, String group)
  {
    SecurityAccess access = (SecurityAccess) getAccess(action);
    if (access.getAllAllows() != null)
    {
      Iterator allAllows = access.getAllows().iterator();
      while (allAllows.hasNext())
      {
        SecurityAllow allow = (SecurityAllow) allAllows.next();
        if (allow.getGroup() != null && allow.getGroup().equals(group))
        {
View Full Code Here

   * Checks whether a group role is specifically allowed to access the request action
   * This method ignores the "*" action and is here to play a maintenance role.
   */
  public boolean allowsSpecificGroupRole(String action, String group, String role)
  {
    SecurityAccess access = (SecurityAccess) getAccess(action);
    if (access.getAllAllows() != null)
    {
      Iterator allAllows = access.getAllows().iterator();
      while (allAllows.hasNext())
      {
        SecurityAllow allow = (SecurityAllow) allAllows.next();
        if (allow.getGroup() != null &&
          allow.getGroup().equals(group) &&
View Full Code Here

     */
    public boolean grantRoleAccess(String action, String role)
    {
        if (!allowsSpecificRole(action, role))
        {
            SecurityAccess access = getAccess(action);
            List allows = access.getAllows();
            if (allows == null)
            {
                allows = new Vector();
            }

View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.registry.SecurityAccess

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.