Package org.infoglue.cms.entities.management

Examples of org.infoglue.cms.entities.management.AccessRight


      List<AccessRightUser> users = new ArrayList<AccessRightUser>();
     
      Iterator entityAccessRightsIterator = entityAccessRights.iterator();
      while(entityAccessRightsIterator.hasNext())
      {
        AccessRight ar = (AccessRight)entityAccessRightsIterator.next();
        if(ar.getUsers().size() > 0 && ar.getRoles().size() == 0 && ar.getGroups().size() == 0)
        {
          users.addAll(ar.getUsers());
          db.remove(ar);
          entityAccessRightsIterator.remove();
          duplicateAutoMergableAccessRightVOListIterator.remove();
          logger.info("Deleted the item with only users...:" + ar.getId());
        }
      }

      entityAccessRightsIterator = entityAccessRights.iterator();
      while(entityAccessRightsIterator.hasNext())
      {
        AccessRight ar = (AccessRight)entityAccessRightsIterator.next();
        if(users.size() > 0)
        {
          logger.info("Adding users " + users.size() + " to " + ar.getId());
          ar.getUsers().addAll(users);
          for(AccessRightUser user : users)
          {
            user.setAccessRight(ar);
          }
        }
View Full Code Here


  {
    String accessRightsStatusText = "";
   
    List<AccessRight> entityAccessRights = getAccessRightListForEntity(interceptionPointId, parameters, db);
   
    AccessRight keeperAR = null;
    Iterator entityAccessRightsIterator = entityAccessRights.iterator();
    while(entityAccessRightsIterator.hasNext())
    {
      AccessRight ar = (AccessRight)entityAccessRightsIterator.next();
      if(entityAccessRightsIterator.hasNext())
      {
        //db.remove(ar);
        delete(ar, db);
        entityAccessRightsIterator.remove();
        logger.info("Deleted the duplicates:" + ar.getId());
      }
      else
        keeperAR = ar;
    }
   
View Full Code Here

   
    int deletable=0;
    QueryResults results = oql.execute(Database.READONLY);
    while (results.hasMore())
    {
      AccessRight accessRight = (AccessRight)results.next();
      AccessRightVO accessRightVO = accessRight.getValueObject();
     
      if(populateRelated)
      {
        AccessRight fullAccessRight = getAccessRightWithId(accessRightVO.getId(), db);
       
        populateDescription(db, accessRightVO, fullAccessRight);
       
        List<AccessRightRoleVO> roles = toVOList(fullAccessRight.getRoles());
        List<AccessRightGroupVO> groups = toVOList(fullAccessRight.getGroups());
        List<AccessRightUserVO> users = toVOList(fullAccessRight.getUsers());
        accessRightVO.getRoles().addAll(roles);
        accessRightVO.getGroups().addAll(groups);
        accessRightVO.getUsers().addAll(users);
        if(roles.size() == 0 && groups.size() == 0 && users.size() == 0)
        {
View Full Code Here

    OQLQuery oql = db.getOQLQuery(sb.toString());
   
    QueryResults results = oql.execute(Database.READONLY);
    while (results.hasMore())
    {
      AccessRight accessRight = (AccessRight)results.next();
      AccessRightVO accessRightVO = accessRight.getValueObject();
      undefinedAccessRights.add(accessRightVO);
    }
   
    results.close();
    oql.close();
View Full Code Here

                    logger.info("parameters:" + parameters);
   
                    AccessRightVO accessRightVO = new AccessRightVO();
                    accessRightVO.setParameters("" + newContentVO.getId());
                   
                    AccessRight accessRight = AccessRightController.getController().create(accessRightVO, interceptionPoint, db);
                   
              @SuppressWarnings("unchecked")
              List<String> accessRightRoles = (List<String>)accessRightMap.get("accessRightRoles");
              if(accessRightRoles != null)
                    {
                Iterator<String> accessRightRolesIterator = accessRightRoles.iterator();
                      while(accessRightRolesIterator.hasNext())
                      {
                          //Map accessRightRoleMap = (Map)accessRightRolesIterator.next();
                         
                          String roleName = accessRightRolesIterator.next();
                         
                    AccessRightRoleVO accessRightRoleVO = new AccessRightRoleVO();
                    accessRightRoleVO.setRoleName(roleName);
                    AccessRightRole accessRightRole = AccessRightController.getController().createAccessRightRole(db, accessRightRoleVO, accessRight);
                  @SuppressWarnings("unchecked")
                  Collection<AccessRightRole> roles = accessRight.getRoles();
                  roles.add(accessRightRole);
                      }
                    }

              @SuppressWarnings("unchecked")
              List<String> accessRightGroups = (List<String>)accessRightMap.get("accessRightGroups");
                    if(accessRightGroups != null)
                    {
                      Iterator<String> accessRightGroupsIterator = accessRightGroups.iterator();
                      while(accessRightGroupsIterator.hasNext())
                      {
                          String groupName = accessRightGroupsIterator.next();
                         
                    AccessRightGroupVO accessRightGroupVO = new AccessRightGroupVO();
                    accessRightGroupVO.setGroupName(groupName);
                    AccessRightGroup accessRightGroup = AccessRightController.getController().createAccessRightGroup(db, accessRightGroupVO, accessRight);
                  @SuppressWarnings("unchecked")
                  Collection<AccessRightGroup> groups = accessRight.getGroups();
                  groups.add(accessRightGroup);
                      }
                    }

              @SuppressWarnings("unchecked")
              List<String> accessRightUsers = (List<String>)accessRightMap.get("accessRightUsers");
                    if(accessRightUsers != null)
                    {
                      Iterator<String> accessRightUsersIterator = accessRightUsers.iterator();
                      while(accessRightUsersIterator.hasNext())
                      {
                          String userName = accessRightUsersIterator.next();
                         
                    AccessRightUserVO accessRightUserVO = new AccessRightUserVO();
                    accessRightUserVO.setUserName(userName);
                    AccessRightUser accessRightUser = AccessRightController.getController().createAccessRightUser(db, accessRightUserVO, accessRight);
                  @SuppressWarnings("unchecked")
                  Collection<AccessRightUser> users = accessRight.getUsers();
                  users.add(accessRightUser);
                      }
                    }

              commitTransaction(db);
View Full Code Here

              Iterator i = accessRightUserList.iterator();
             
            while(i.hasNext())
              {
                  AccessRightUser accessRightUser = (AccessRightUser)i.next();
                  AccessRight accessRight = accessRightUser.getAccessRight();

                  boolean exists = false;
                  Iterator usersIterator = accessRight.getUsers().iterator();
                  while(usersIterator.hasNext())
                  {
                    AccessRightUser currentAccessRightUser = (AccessRightUser)usersIterator.next();
                    if(currentAccessRightUser.getUserName().equals(newUserName))
                      exists = true;
                  }

                  if(!exists)
                  {
                    //accessRightUser.setUserName(newUserName);
              AccessRightUserVO accessRightUserVO = new AccessRightUserVO();
              accessRightUserVO.setUserName(newUserName);
              AccessRightUser newAccessRightUser = AccessRightController.getController().createAccessRightUser(db, accessRightUserVO, accessRight);
              accessRight.getUsers().add(newAccessRightUser);
                  }
              }             
          }
          catch(Exception e)
          {
View Full Code Here

              Iterator i = accessRightRoleList.iterator();
             
            while(i.hasNext())
              {
                  AccessRightRole accessRightRole = (AccessRightRole)i.next();
                  AccessRight accessRight = accessRightRole.getAccessRight();
                 
                  if(accessRight != null)
                  {
                    boolean exists = false;

                    Iterator rolesIterator = accessRight.getRoles().iterator();
                    while(rolesIterator.hasNext())
                    {
                      AccessRightRole currentAccessRightRole = (AccessRightRole)rolesIterator.next();
                      if(currentAccessRightRole.getRoleName().equals(newRoleName))
                        exists = true;
                    }
                 
                    if(!exists)
                    {
                      //accessRightRole.setRoleName(newRoleName);
                AccessRightRoleVO accessRightRoleVO = new AccessRightRoleVO();
                accessRightRoleVO.setRoleName(newRoleName);
                AccessRightRole newAccessRightRole = AccessRightController.getController().createAccessRightRole(db, accessRightRoleVO, accessRight);
                accessRight.getRoles().add(newAccessRightRole);
                    }
                  }                 
              }             
          }
          catch(Exception e)
View Full Code Here

              Iterator i = accessRightGroupList.iterator();
             
            while(i.hasNext())
              {
                  AccessRightGroup accessRightGroup = (AccessRightGroup)i.next();
                  AccessRight accessRight = accessRightGroup.getAccessRight();

                  boolean exists = false;
                  Iterator groupsIterator = accessRight.getGroups().iterator();
                  while(groupsIterator.hasNext())
                  {
                    AccessRightGroup currentAccessRightGroup = (AccessRightGroup)groupsIterator.next();
                    if(currentAccessRightGroup.getGroupName().equals(newGroupName))
                      exists = true;
                  }
                 
                  if(!exists)
                  {
                    //accessRightGroup.setGroupName(newGroupName);
              AccessRightGroupVO accessRightGroupVO = new AccessRightGroupVO();
              accessRightGroupVO.setGroupName(newGroupName);
              AccessRightGroup newAccessRightGroup = AccessRightController.getController().createAccessRightGroup(db, accessRightGroupVO, accessRight);
              accessRight.getGroups().add(newAccessRightGroup);
                  }
              }             
          }
          catch(Exception e)
          {
View Full Code Here

    Collection<AccessRight> accessRights = infoGlueExportImplRead.getAccessRights();
    Iterator<AccessRight> accessRightsIterator = accessRights.iterator();
    while(accessRightsIterator.hasNext())
    {
      AccessRight accessRight = accessRightsIterator.next();

      InterceptionPoint interceptionPoint = InterceptionPointController.getController().getInterceptionPointWithName(accessRight.getInterceptionPointName(), db);
      accessRight.setInterceptionPoint(interceptionPoint);
      if(interceptionPoint.getName().indexOf("Content") > -1)
        accessRight.setParameters((String)contentIdMap.get(accessRight.getParameters()));
      else if(interceptionPoint.getName().indexOf("SiteNodeVersion") > -1)
        accessRight.setParameters((String)siteNodeVersionIdMap.get(accessRight.getParameters()));
      else if(interceptionPoint.getName().indexOf("SiteNode") > -1)
        accessRight.setParameters((String)siteNodeIdMap.get(accessRight.getParameters()));
      else if(interceptionPoint.getName().indexOf("Repository") > -1)
        accessRight.setParameters((String)repositoryIdMap.get(accessRight.getParameters()));

      db.create(accessRight);

      Iterator accessRightRoleIterator = accessRight.getRoles().iterator();
      while(accessRightRoleIterator.hasNext())
      {
        AccessRightRole accessRightRole = (AccessRightRole)accessRightRoleIterator.next();
        accessRightRole.setAccessRight(accessRight);
        db.create(accessRightRole);
      }

      Iterator accessRightGroupIterator = accessRight.getGroups().iterator();
      while(accessRightGroupIterator.hasNext())
      {
        AccessRightGroup accessRightGroup = (AccessRightGroup)accessRightGroupIterator.next();
        accessRightGroup.setAccessRight(accessRight);
        db.create(accessRightGroup);
View Full Code Here

    Collection<AccessRight> accessRights = infoGlueExportImplRead.getAccessRights();
    Iterator<AccessRight> accessRightsIterator = accessRights.iterator();
    while(accessRightsIterator.hasNext())
    {
      AccessRight accessRight = accessRightsIterator.next();

      InterceptionPoint interceptionPoint = InterceptionPointController.getController().getInterceptionPointWithName(accessRight.getInterceptionPointName(), db);
      if(interceptionPoint != null)
      {
        accessRight.setInterceptionPoint(interceptionPoint);
        if(interceptionPoint.getName().indexOf("Content") > -1)
          accessRight.setParameters((String)contentIdMap.get(accessRight.getParameters()));
        else if(interceptionPoint.getName().indexOf("SiteNodeVersion") > -1)
          accessRight.setParameters((String)siteNodeVersionIdMap.get(accessRight.getParameters()));
        else if(interceptionPoint.getName().indexOf("SiteNode") > -1)
          accessRight.setParameters((String)siteNodeIdMap.get(accessRight.getParameters()));
        else if(interceptionPoint.getName().indexOf("Repository") > -1)
          accessRight.setParameters((String)repositoryIdMap.get(accessRight.getParameters()));
 
        db.create(accessRight);
 
        Iterator accessRightRoleIterator = accessRight.getRoles().iterator();
        while(accessRightRoleIterator.hasNext())
        {
          AccessRightRole accessRightRole = (AccessRightRole)accessRightRoleIterator.next();
          accessRightRole.setAccessRight(accessRight);
          db.create(accessRightRole);
        }
 
        Iterator accessRightGroupIterator = accessRight.getGroups().iterator();
        while(accessRightGroupIterator.hasNext())
        {
          AccessRightGroup accessRightGroup = (AccessRightGroup)accessRightGroupIterator.next();
          accessRightGroup.setAccessRight(accessRight);
          db.create(accessRightGroup);
View Full Code Here

TOP

Related Classes of org.infoglue.cms.entities.management.AccessRight

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.