Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.User


    return addUser(username, true);
  }

  public User addUser(String username, boolean mapped) throws SecurityException
  {
    User user = newUser(username, mapped);
   
    super.addPrincipal(user, null);

    if (log.isDebugEnabled())
      log.debug("Added user: " + username);
View Full Code Here


    }
  }

  public User getUser(String username) throws SecurityException
  {
      User user = (User)getPrincipal(username);
      if (null == user)
      {
          throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.USER, username));
      }
      return user;
View Full Code Here

    }
    System.out.println("user manager = " + userManager);
    try {
      Iterator users = userManager.getUsers("");
      while (users.hasNext()) {
        User user = (User) users.next();
        System.out.println("++++ User = " + user);
        Principal principal = getPrincipal(user.getSubject(),
            UserPrincipal.class);
        System.out.println("principal = " + principal.getName());
      }
    } catch (SecurityException se) {
      throw new PortletException(se);
View Full Code Here

            // TODO: need to try to normalize List/Collection/Iterators
            List list = new ArrayList();
            while (users.hasNext())
            {
                User user = (User)users.next();
                Principal principal = getPrincipal(user.getSubject(),
                        UserPrincipal.class);               
                list.add(principal.getName());
            }           
            BrowserIterator iterator = new DatabaseBrowserIterator(
                    list, resultSetTitleList, resultSetTypeList,
View Full Code Here

                    Iterator users = userManager.getUsers(USER_FILTER);
                    control = buildTree(users, actionRequest.getLocale());
                    actionRequest.getPortletSession().setAttribute(TREE_CONTROL, control);
                    selectNode(actionRequest, control, userName);
                   
                    User user = userManager.getUser(userName);
                    String role = actionRequest.getParameter(ROLES_CONTROL);
                    if (!isEmpty(role) && user != null)
                    {
                        roleManager.addRoleToUser(userName, role);
                    }

                    String rule = actionRequest.getParameter(RULES_CONTROL);
                    if (!isEmpty(rule) && user != null)
                    {
                        Principal principal = getPrincipal(user.getSubject(), UserPrincipal.class);                        
                        profiler.setRuleForPrincipal(principal, profiler.getRule(rule), "page");
                    }
                   
                }
                catch (SecurityException se)
View Full Code Here

                USER_DOMAIN); // domain
        root.addChild(userTree);

        while (users.hasNext())
        {
            User user = (User) users.next();
            Principal principal = getPrincipal(user.getSubject(), UserPrincipal.class);

            TreeControlNode userNode = new TreeControlNode(principal.getName(), null, principal.getName(),
                    SecurityResources.PORTLET_URL, null, false, USER_DETAIL_DOMAIN);
            userTree.addChild(userNode);
        }
View Full Code Here

       
        String userName = (String)
            request.getPortletSession().getAttribute(SecurityResources.PAM_CURRENT_USER,
                                         PortletSession.APPLICATION_SCOPE);

        User user = null;
        if (userName != null)
        {
            // TODO: don't lookup with every view call
            user = lookupUser(userName);
        }
View Full Code Here

    throws PortletException
    {
        String userName = (String)
            actionRequest.getPortletSession().getAttribute(SecurityResources.PAM_CURRENT_USER,
                             PortletSession.APPLICATION_SCOPE);
        User user = lookupUser(userName);
        if (user != null)
        {
            try
            {
                userManager.removeUser(userName);
View Full Code Here

        ResourceBundle bundle = ResourceBundle.getBundle("org.apache.jetspeed.portlets.security.resources.UsersResources",actionRequest.getLocale());

        String userName = (String)
        actionRequest.getPortletSession().getAttribute(SecurityResources.PAM_CURRENT_USER,
                             PortletSession.APPLICATION_SCOPE);
        User user = lookupUser(userName);
        if (user != null)
        {
            try
            {
                String password = actionRequest.getParameter("user_cred_value");
View Full Code Here

    private void updateUserAttribute(ActionRequest actionRequest, ActionResponse actionResponse)
    {
        String userName = (String)
            actionRequest.getPortletSession().getAttribute(SecurityResources.PAM_CURRENT_USER,
                                 PortletSession.APPLICATION_SCOPE);
        User user = lookupUser(userName);
        if (user != null)
        {
            String[] userAttrNames = actionRequest.getParameterValues("user_attr_id");
            if(userAttrNames != null)
            {               
                for (int i=0; i<userAttrNames.length; i++)
                {
                    String userAttrName = userAttrNames[i];
                    String value = actionRequest.getParameter(userAttrName + ":value");
                    user.getUserAttributes().put(userAttrName, value);
                }               
            }       
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.security.User

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.