Package org.apache.jetspeed.om.security

Examples of org.apache.jetspeed.om.security.GroupRole


        try
        {
            Iterator roles = service.getRoles("turbine");
            while (roles.hasNext())
            {
              GroupRole gr = (GroupRole) roles.next();
                role = gr.getRole();
                map.put(role.getName(), role);
                System.out.println("role = " + role.getName());
            }
            assertTrue(map.get("user") != null);
            assertTrue(map.get("admin") == null);

            map.clear();
            roles = service.getRoles("admin");           
            while (roles.hasNext())
            {
                GroupRole gr = (GroupRole)roles.next();
                role = gr.getRole();
                map.put(role.getName(), role);
                System.out.println("role = " + role.getName());
            }
            assertTrue(map.get("user") != null);
            assertTrue(map.get("admin") != null);
View Full Code Here


        try
        {
      for( Iterator roles = JetspeedRoleManagement.getRoles(user.getUserName()); roles.hasNext();)
      {
        GroupRole grouprole = (GroupRole) roles.next();
        String groupname = grouprole.getGroup().getName();
        String rolename = grouprole.getRole().getName();
        if (securityEntry.allowsGroupRole(groupname, rolename, action))
          return true;         
      }

//            for( Iterator roles = JetspeedRoleManagement.getRoles(user.getUserName()); roles.hasNext();)
View Full Code Here

        {
            CachedAcl acl = (CachedAcl) valueIter.next();
            Iterator roleIter = acl.getRoles();
            while (roleIter.hasNext())
            {
                GroupRole groupRole = (GroupRole) roleIter.next();
                if(groupRole.getGroup().getName().equals(groupName))
                {
                    roleIter.remove();
              }
          }
        }
View Full Code Here

        if (groupRoles != null)
        {
            while (groupRoles.hasNext())
            {
                // note: this is an unordered list. will need to change db schema to order it
                GroupRole gr = (GroupRole) groupRoles.next();
                rundata.getParameters().setString(
                    Profiler.PARAM_ROLE,
                    gr.getRole().getName());
                profile = fallbackProfile(rundata, cm);
                if (profile != null)
                {
                    profiles.add(profile);
                }
View Full Code Here

   * @param role
   * @param group
   */
  public void addRole(Role role, Group group)
  {
    GroupRole gr = new BaseJetspeedGroupRole();
    gr.setRole(role);
    gr.setGroup(group);
    String key = getGroupRoleKey(group.getName(), role.getName());
    groupRoles.put(key, gr);
  }
View Full Code Here

   * @param groupName
   * @return
   */
  public Role getRole(String roleName, String groupName)
  {
    GroupRole gr = (GroupRole) groupRoles.get(getGroupRoleKey(groupName, roleName));
    return gr != null ? gr.getRole() : null;
  }
View Full Code Here

   */
  public void setRoles(Iterator grouproles)
  {
    while (grouproles.hasNext())
    {
      GroupRole grouprole = (GroupRole) grouproles.next();
      String key = getGroupRoleKey(grouprole.getGroup().getName(), grouprole.getRole().getName());
      this.groupRoles.put(key, grouprole);
    }
  }
View Full Code Here

               
        Vector selected = new Vector();
        Iterator groupRoles = JetspeedSecurity.getRoles(userid);
    while (groupRoles.hasNext())
    {
      GroupRole gr = (GroupRole) groupRoles.next();
      selected.add(gr.getGroup().getName() + gr.getRole().getName());
    }

        rundata.getUser().setTemp(SecurityConstants.CONTEXT_ROLES, masterRoles);
    rundata.getUser().setTemp(SecurityConstants.CONTEXT_GROUPS, masterGroups);       
        rundata.getUser().setTemp(SecurityConstants.CONTEXT_SELECTED, selected);
View Full Code Here

        try
        {
            Iterator roles = JetspeedSecurity.getRoles(user.getUserName());
            while (roles.hasNext())
            {
                GroupRole gr = (GroupRole) roles.next();
                Role role = gr.getRole();
                return JetspeedSecurity.hasPermission(role.getName(), action);
            }
       
        } catch (Exception e)
        {
View Full Code Here

            for (int ix = 0; ix < rels.size(); ix++)
            {
        TurbineUserGroupRole rel = (TurbineUserGroupRole) rels.get(ix);
        Role role = rel.getTurbineRole();
        Group group = rel.getTurbineGroup();
        GroupRole groupRole = new BaseJetspeedGroupRole();
        groupRole.setGroup(group);
        groupRole.setRole(role);
        roles.put(group.getName() + role.getName(), groupRole);
            }
        }
        catch(Exception e)
        {
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.security.GroupRole

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.