Package org.exoplatform.services.security

Examples of org.exoplatform.services.security.ConversationState


         //
         begin();

         //
         ConversationState conversationState = null;
         if (userId != null)
         {
            try
            {
               conversationState = new ConversationState(authenticator.createIdentity(userId));
            }
            catch (Exception e)
            {
               failure = e;
            }
View Full Code Here


   {
   }

   public User getUser()
   {
      ConversationState state = ConversationState.getCurrent();
      return (User)state.getAttribute(CacheUserProfileFilter.USER_PROFILE);
   }
View Full Code Here

    * @param group
    * @return
    */
   public boolean isUserInGroup(String group)
   {
      ConversationState conv = ConversationState.getCurrent();
      Identity id = null;
      if (conv != null)
      {
         id = conv.getIdentity();
      }

      if (id == null)
      {
         return false;
View Full Code Here

      return false;
   }

   private Identity getIdentity()
   {
      ConversationState conv = ConversationState.getCurrent();
      if (conv == null)
      {
         return guest;
      }

      Identity id = conv.getIdentity();
      if (id == null)
      {
         return guest;
      }
View Full Code Here

    */
   private static Log log = ExoLogger.getLogger("core.security.SetCurrentIdentityFilter");

   public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException
   {
      ConversationState state = ConversationState.getCurrent();
      try
      {
         if (state != null)
         {
            if (log.isDebugEnabled())
               log.debug("Conversation State found, save user profile to Conversation State.");

            if (state.getAttribute(USER_PROFILE) == null)
            {
               OrganizationService orgService =
                  (OrganizationService)getContainer().getComponentInstanceOfType(OrganizationService.class);

               begin(orgService);
               User user = orgService.getUserHandler().findUserByName(state.getIdentity().getUserId());
               end(orgService);
               state.setAttribute(USER_PROFILE, user);

            }

         }
         chain.doFilter(request, response);
View Full Code Here

         removeMembership(null, group);
      }

      public void run(Runnable runnable)
      {
         ConversationState.setCurrent(new ConversationState(identity));
         try
         {
            runnable.run();
         }
         finally
View Full Code Here

         }
      }

      public boolean hasEditPermission(PageNavigation nav)
      {
         ConversationState.setCurrent(new ConversationState(identity));
         try
         {
            return ua.hasEditPermission(nav);
         }
         finally
View Full Code Here

         }
      }

      public boolean hasPermission(Page page)
      {
         ConversationState.setCurrent(new ConversationState(identity));
         try
         {
            return ua.hasPermission(page);
         }
         finally
View Full Code Here

         }
      }

      public boolean hasEditPermission(Page page)
      {
         ConversationState.setCurrent(new ConversationState(identity));
         try
         {
            return ua.hasEditPermission(page);
         }
         finally
View Full Code Here

         }
      }

      public boolean hasPermission(PortalConfig portal)
      {
         ConversationState.setCurrent(new ConversationState(identity));
         try
         {
            return ua.hasPermission(portal);
         }
         finally
View Full Code Here

TOP

Related Classes of org.exoplatform.services.security.ConversationState

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.