Package org.exoplatform.services.security

Examples of org.exoplatform.services.security.Identity


      return false;
   }

   public boolean hasEditPermission(Page page)
   {
      Identity identity = getIdentity();
      if (PortalConfig.USER_TYPE.equals(page.getOwnerType()))
      {
         if (page.getOwnerId().equals(identity.getUserId()))
         {
            page.setModifiable(true);
            return true;
         }
         return false;
View Full Code Here


    * PortalDataMapper
    *
    */
   public boolean hasEditPermissionOnPage(String ownerType, String ownerId, String editPermExpression)
   {
      Identity identity = this.getIdentity();

      if (PortalConfig.USER_TYPE.equals(ownerType))
      {
         if (ownerId.equals(identity.getUserId()))
         {
            return true;
         }
         return false;
      }
View Full Code Here

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

      if (id == null)
      {
         return false;
      }

      Iterator<String> iter = id.getGroups().iterator();

      while (iter.hasNext())
      {
         if (iter.next().equals(group))
         {
View Full Code Here

      if (conv == null)
      {
         return guest;
      }

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

      return adminMSType;
   }

   public boolean hasPermission(PortalConfig pconfig)
   {
      Identity identity = getIdentity();
      if (hasPermission(identity, pconfig.getEditPermission()))
      {
         pconfig.setModifiable(true);
         return true;
      }
View Full Code Here

    * @param editPermExpression the permission expression
    * @return true or false
    */
   public boolean hasEditPermissionOnPortal(String ownerType, String ownerId, String editPermExpression)
   {
      Identity identity = this.getIdentity();
      if(superUser_.equals(identity.getUserId()))
      {
         return true;
      }
     
      if(PortalConfig.USER_TYPE.equals(ownerType)){
         return identity.getUserId().equals(ownerId);
      }
     
      return hasPermission(identity, editPermExpression);
   }
View Full Code Here

      return hasPermission(identity, editPermExpression);
   }

   public boolean hasCreatePortalPermission()
   {
      Identity identity = getIdentity();
      if (superUser_.equals(identity.getUserId()))
      {
         return true;
      }
      if (portalCreatorGroups_ == null || portalCreatorGroups_.size() < 1)
      {
View Full Code Here

   }

   // copied from @link{#hasEditPermission}
   public boolean hasEditPermissionOnNavigation(SiteKey siteKey)
   {
      Identity identity = getIdentity();
      if (superUser_.equals(identity.getUserId()))
      {
         return true;
      }

      //
      switch (siteKey.getType())
      {
         case PORTAL:
            //TODO: We should also take care of Portal's navigation
            return false;
         case GROUP:
            String temp = siteKey.getName().trim();
            String expAdminGroup = getAdminGroups();
            String expPerm = null;

            // Check to see whether current user is member of admin group or not,
            // if so grant
            // edit permission for group navigation for that user.
            if (expAdminGroup != null)
            {
               expAdminGroup = expAdminGroup.startsWith("/") ? expAdminGroup : "/" + expAdminGroup;
               expPerm = temp.startsWith("/") ? temp : "/" + temp;
               if (isUserInGroup(expPerm) && isUserInGroup(expAdminGroup))
               {
                  return true;
               }
            }

            expPerm = navigationCreatorMembershipType_ + (temp.startsWith("/") ? ":" + temp : ":/" + temp);
            return hasPermission(identity, expPerm);
         case USER:
            return siteKey.getName().equals(identity.getUserId());
         default:
            return false;
      }
   }
View Full Code Here

      }
   }

   public boolean hasPermission(Page page)
   {
      Identity identity = getIdentity();
      if (PortalConfig.USER_TYPE.equals(page.getOwnerType()))
      {
         if (page.getOwnerId().equals(identity.getUserId()))
         {
            page.setModifiable(true);
            return true;
         }
      }
      if (superUser_.equals(identity.getUserId()))
      {
         page.setModifiable(true);
         return true;
      }
      if (hasEditPermission(page))
View Full Code Here

        if (authenticator == null) {
            throw new LoginException("No Authenticator component found, check your configuration");
        }

        Identity identity = authenticator.createIdentity(username);

        sharedState.put("exo.security.identity", identity);
        sharedState.put("javax.security.auth.login.name", username);
        subject.getPublicCredentials().add(new UsernameCredential(username));
    }
View Full Code Here

TOP

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

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.