Package org.infoglue.cms.security

Examples of org.infoglue.cms.security.InfoGluePrincipal


        PageDeliveryMetaDataEntityImpl.class.getName().indexOf(object.getClass().getName()) == -1)
      {
          String userName = "SYSTEM";
      try
      {
        InfoGluePrincipal principal = InfoGlueAbstractAction.getSessionInfoGluePrincipal();
        if(principal != null && principal.getName() != null)
          userName = principal.getName();
        }
      catch (NoClassDefFoundError e){}
     
        String storedClassName = getNotificationClassNameAndAddExtraInfo(object, false);
          NotificationMessage notificationMessage = new NotificationMessage("CMSJDOCallback", storedClassName, userName, NotificationMessage.TRANS_CREATE, getObjectIdentity(object), getObjectName(object), CacheController.getExtraInfo(storedClassName, getObjectIdentity(object).toString()));
View Full Code Here


        PageDeliveryMetaDataEntityImpl.class.getName().indexOf(object.getClass().getName()) == -1)
      {
             String userName = "SYSTEM";
      try
     
        InfoGluePrincipal principal = InfoGlueAbstractAction.getSessionInfoGluePrincipal();
        if(principal != null && principal.getName() != null)
          userName = principal.getName();
      }
      catch (NoClassDefFoundError e){}

        String storedClassName = getNotificationClassNameAndAddExtraInfo(object, true);
        NotificationMessage notificationMessage = new NotificationMessage("CMSJDOCallback", storedClassName, userName, NotificationMessage.TRANS_DELETE, getObjectIdentity(object), getObjectName(object), CacheController.getExtraInfo(storedClassName, getObjectIdentity(object).toString()));
View Full Code Here

                      if(principal != null && filter != null && filter.equalsIgnoreCase("groupBased"))
                      {
                        String versionModifier = contentVersionVO.getVersionModifier();
                        if(versionModifier != null)
                        {
                          InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
                          if(versionModifierPrincipal != null)
                          {
                            boolean hasGroup = false;
                           
                            List groups = versionModifierPrincipal.getGroups();
                            Iterator groupsIterator = groups.iterator();
                            while(groupsIterator.hasNext())
                            {
                              InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
                              if(principal.getGroups().contains(group))
                                hasGroup = true;
                            }
                           
                            if(!hasGroup)
                              isValid = false;
                          }
                        }
                      }
                      else if(principal != null && filter != null && filter.indexOf("groupNameBased_") > -1)
                      {
                        String versionModifier = contentVersionVO.getVersionModifier();
                        if(versionModifier != null)
                        {
                          InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
                          if(versionModifierPrincipal != null)
                          {
                            boolean hasGroup = false;
                            String groupName = filter.substring(filter.indexOf("_") + 1);
                           
                            List groups = versionModifierPrincipal.getGroups();
                            Iterator groupsIterator = groups.iterator();
                            while(groupsIterator.hasNext())
                            {
                              InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
                              if(groupName.equalsIgnoreCase(group.getName()))
                                hasGroup = true;
                            }
                           
                            if(!hasGroup)
                              isValid = false;
                          }
                        }                   
                      }
                    }
                  }
            else if(event.getEntityClass().equalsIgnoreCase(SiteNodeVersion.class.getName()))
            {
              SiteNodeVersionVO siteNodeVersion = null;
              SiteNodeVO siteNode = null;
              try
                    {
                siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(event.getEntityId(), db);
                //siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionWithIdAsReadOnly(event.getEntityId(), db);
                if(siteNodeVersion.getSiteNodeId() != null)
                  siteNode = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeVersion.getSiteNodeId(), db);
                    }
                    catch(SystemException e)
                    {
                      hasBrokenItems = true;
                      throw e;
                    }
 
              if(siteNodeVersion == null || siteNode == null)
              {
                      hasBrokenItems = true;
                  isValid = false;
              }
              else
                    {
                      if(principal != null && filter != null && filter.equalsIgnoreCase("groupBased"))
                      {
                        String versionModifier = siteNodeVersion.getVersionModifier();
                        if(versionModifier != null)
                        {
                          InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
                          if(versionModifierPrincipal != null)
                          {
                            boolean hasGroup = false;
                           
                            List groups = versionModifierPrincipal.getGroups();
                            Iterator groupsIterator = groups.iterator();
                            while(groupsIterator.hasNext())
                            {
                              InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
                              if(principal.getGroups().contains(group))
                                hasGroup = true;
                            }
                           
                            if(!hasGroup)
                              isValid = false;
                          }
                        }
                }
                      else if(principal != null && filter != null && filter.indexOf("groupNameBased_") > -1)
                      {
                        String versionModifier = siteNodeVersion.getVersionModifier();
                        if(versionModifier != null)
                        {
                          InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
                          if(versionModifierPrincipal != null)
                          {
                            boolean hasGroup = false;
                            String groupName = filter.substring(filter.indexOf("_") + 1);
                           
                            List groups = versionModifierPrincipal.getGroups();
                            Iterator groupsIterator = groups.iterator();
                            while(groupsIterator.hasNext())
                            {
                              InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
                              if(groupName.equalsIgnoreCase(group.getName()))
View Full Code Here

                    if(principal != null && filter != null && filter.equalsIgnoreCase("groupBased"))
                    {
                      String versionModifier = contentVersionVO.getVersionModifier();
                      if(versionModifier != null)
                      {
                        InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
                        if(versionModifierPrincipal != null)
                        {
                          boolean hasGroup = false;
                         
                          List groups = versionModifierPrincipal.getGroups();
                          Iterator groupsIterator = groups.iterator();
                          while(groupsIterator.hasNext())
                          {
                            InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
                            if(principal.getGroups().contains(group))
                              hasGroup = true;
                          }
                         
                          if(!hasGroup)
                            isValid = false;
                        }
                      }
                    }
                    else if(principal != null && filter != null && filter.indexOf("groupNameBased_") > -1)
                    {
                      String versionModifier = contentVersionVO.getVersionModifier();
                      if(versionModifier != null)
                      {
                        InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
                        if(versionModifierPrincipal != null)
                        {
                          boolean hasGroup = false;
                          String groupName = filter.substring(filter.indexOf("_") + 1);
                         
                          List groups = versionModifierPrincipal.getGroups();
                          Iterator groupsIterator = groups.iterator();
                          while(groupsIterator.hasNext())
                          {
                            InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
                            if(groupName.equalsIgnoreCase(group.getName()))
                              hasGroup = true;
                          }
                         
                          if(!hasGroup)
                            isValid = false;
                        }
                      }                   
                    }
                  }
                }
          else if(event.getEntityClass().equalsIgnoreCase(SiteNodeVersion.class.getName()))
          {
            SiteNodeVersionVO siteNodeVersion = null;
            SiteNodeVO siteNode = null;
           
            try
                  {
              siteNodeVersion = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(event.getEntityId(), db);
              if(siteNodeVersion != null && siteNodeVersion.getSiteNodeId() != null)
                siteNode = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeVersion.getSiteNodeId(), db);
                  }
                  catch(SystemException e)
                  {
                    isBroken = true;
                    throw e;
                  }

            if(siteNodeVersion == null || siteNode == null)
            {
                isBroken = true;
                isValid = false;
                SiteNodeVersionController.getController().delete(siteNodeVersion.getId(), db);
            }
            else
                  {
                    if(principal != null && filter != null && filter.equalsIgnoreCase("groupBased"))
                    {
                      String versionModifier = siteNodeVersion.getVersionModifier();
                      if(versionModifier != null)
                      {
                        InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
                        if(versionModifierPrincipal != null)
                        {
                          boolean hasGroup = false;
                         
                          List groups = versionModifierPrincipal.getGroups();
                          Iterator groupsIterator = groups.iterator();
                          while(groupsIterator.hasNext())
                          {
                            InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
                            if(principal.getGroups().contains(group))
                              hasGroup = true;
                          }
                         
                          if(!hasGroup)
                            isValid = false;
                        }
                      }
              }
                    else if(principal != null && filter != null && filter.indexOf("groupNameBased_") > -1)
                    {
                      String versionModifier = siteNodeVersion.getVersionModifier();
                      if(versionModifier != null)
                      {
                        InfoGluePrincipal versionModifierPrincipal = UserControllerProxy.getController(db).getUser(versionModifier);
                        if(versionModifierPrincipal != null)
                        {
                          boolean hasGroup = false;
                          String groupName = filter.substring(filter.indexOf("_") + 1);
                         
                          List groups = versionModifierPrincipal.getGroups();
                          Iterator groupsIterator = groups.iterator();
                          while(groupsIterator.hasNext())
                          {
                            InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
                            if(groupName.equalsIgnoreCase(group.getName()))
View Full Code Here

    {
      beginTransaction(db);

      try
      {
          InfoGluePrincipal infoGluePrincipal = UserControllerProxy.getController(db).getUser(userName);
          if(infoGluePrincipal == null)
              throw new SystemException("The user named " + userName + " does not exist in the system.");
      }
      catch(Exception e)
      {
View Full Code Here

          AccessRightUser accessRightUser = (AccessRightUser)accessRightUsersIterator.next();

          AccessRightsUserRow accessRightsUserRow = (AccessRightsUserRow)accessRightsUserRows.get(accessRightUser.getUserName());
          if(accessRightsUserRow == null)
          {
            InfoGluePrincipal infoGluePrincipal = UserControllerProxy.getController(db).getUser(accessRightUser.getUserName());
            if(infoGluePrincipal != null)
              {
                  AccessRightsUserRow newAccessRightsUserRow = new AccessRightsUserRow();
                  newAccessRightsUserRow.setUserName(infoGluePrincipal.getName());
                  newAccessRightsUserRow.getAccessRights().put(accessRightUser.getAccessRight().getInterceptionPoint().getId(), new Boolean(true));
                  accessRightsUserRows.put(infoGluePrincipal.getName(), newAccessRightsUserRow);
              }
          }
          else
          {
              accessRightsUserRow.getAccessRights().put(accessRightUser.getAccessRight().getInterceptionPoint().getId(), new Boolean(true));
View Full Code Here

    String encodedUserName  = URLEncoder.encode(URLEncoder.encode(this.userName, URIEncoding), URIEncoding);

    List buttons = new ArrayList();
    if(!this.userName.equals(CmsPropertyHandler.getAnonymousUser()))
    {
      InfoGluePrincipal user = UserControllerProxy.getController().getUser(this.userName);
      if(user.getAutorizationModule().getSupportDelete())
        buttons.add(new ImageButton("Confirm.action?header=tool.managementtool.deleteSystemUser.header&yesDestination=" + URLEncoder.encode("DeleteSystemUser.action?userName=" + URLEncoder.encode(this.userName, URIEncoding), URIEncoding) + "&noDestination=" + URLEncoder.encode("ViewListSystemUser.action?title=SystemUsers", URIEncoding) + "&message=tool.managementtool.deleteSystemUser.text&extraParameters=" + encodedUserName, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.deleteSystemUser"), "tool.managementtool.deleteSystemUser.header"));
   
      if(user.getAutorizationModule().getSupportUpdate())
        buttons.add(new ImageButton("UpdateSystemUserPassword!input.action?userName=" + encodedUserName, getLocalizedString(getSession().getLocale(), "images.managementtool.buttons.updateSystemUserPassword"), "Update user password"));
    }
   
    List contentTypeDefinitionVOList = UserPropertiesController.getController().getContentTypeDefinitionVOList(this.userName);
    if(contentTypeDefinitionVOList.size() > 0)
View Full Code Here

    {
      //This first part handles simple subscriptions - that is subscriptions on an interception point with id or without filters
      String email = subscriptionVO.getUserEmail();
      if(email == null)
      {
        InfoGluePrincipal principal = UserControllerProxy.getController(db).getUser(subscriptionVO.getUserName());
        if(principal != null)
        {
          logger.info("principal:" + principal.getEmail());
          email = principal.getEmail();
        }
      }
     
      logger.info("Was a simple subscription without filters:" + email);
     
View Full Code Here

           
            try
            {
              SessionInfoBean sib = new SessionInfoBean(sess.getId());
             
              InfoGluePrincipal principal = (InfoGluePrincipal)sess.getAttribute(InfoGlueAuthenticationFilter.INFOGLUE_FILTER_USER);
              if(principal == null)
                principal = (InfoGluePrincipal)sess.getAttribute("infogluePrincipal");
             
              if(principal != null)
              {
View Full Code Here

                String s = (String) iter.next();
                HttpSession sess = (HttpSession) sessions.get(s);
               
                try
                {
                  InfoGluePrincipal principal = (InfoGluePrincipal)sess.getAttribute(InfoGlueAuthenticationFilter.INFOGLUE_FILTER_USER);
                  if(principal == null)
                    principal = (InfoGluePrincipal)sess.getAttribute("infogluePrincipal");
                 
                  if(principal != null)
                  {
                    CacheController.clearCache("principalCache");
                    CacheController.clearCache("authorizationCache");
                    CacheController.clearCache("personalAuthorizationCache");

                    InfoGluePrincipal newUser = UserControllerProxy.getController().getUser(principal.getName());
                    sess.setAttribute(InfoGlueAuthenticationFilter.INFOGLUE_FILTER_USER, newUser);
                  }
                }
                catch (Exception e)
                {
View Full Code Here

TOP

Related Classes of org.infoglue.cms.security.InfoGluePrincipal

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.