Jetspeed 2
  1. Jetspeed 2
  2. JS2-503

UserManager's setUserEnabled() method fails after creating new users

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-FINAL
    • Fix Version/s: 2.1-dev, 2.1
    • Component/s: Security
    • Labels:
      None
    • Environment:
      Windows XP

      Description

      If I create a new user using the Admin component

      (_portalAdmin.registerUser(user.getEmailAddress(), user.getPassword(), user.getRoles(), user.getGroups(), null, profilingRules, null);

      and then call the UserManager's setUserEnabled method, it will fail because it cannot find the user

      (_userManager.setUserEnabled(user.getEmailAddress(), false)

      I stepped through the source code and it appears that in the method:

      org.apache.jetspeed.security.spi.impl.DefaultUserSecurityHander.updateUserPrincipal(UserPrincipal userPrincipal) is calling

      InternalUserPrincipal internalUser = securityAccess.getInternalUserPrincipal(fullPath, false); which instead of a fullpath needs to be passed a username instead. So what happens is that it tries to find a user with "/user/myuser@blah/com" instead of "myuser@blah/com".

      I have confirmed that after calling the registerUser method, the user does exist in the database and there is no reason that the InternalUserPrincipal object should be coming back null in the updateUserPrincipal method described above.

        Activity

        Hide
        Ate Douma added a comment -

        Confirmed and fixed.

        Also found the same incorrect usage of SecurityAccess.getInternalUserPrincipal in DefaultUserSecurityHandler.addUserPrincipal

        Thanks for finding this one Grant!

        Show
        Ate Douma added a comment - Confirmed and fixed. Also found the same incorrect usage of SecurityAccess.getInternalUserPrincipal in DefaultUserSecurityHandler.addUserPrincipal Thanks for finding this one Grant!

          People

          • Assignee:
            Ate Douma
            Reporter:
            Grant Gochnauer
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development