Commit 77787224 authored by Alinga Yeung's avatar Alinga Yeung
Browse files

Merge branch 's1840' of /srv/cadc/git/wopencadc into s1840

parents 6278e836 6928a0c9
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -91,9 +91,9 @@ public interface UserPersistence<T extends Principal>
            throws TransientException, AccessControlException;

    /**
     * Add the new user.
     * Add the user to the active user tree.
     *
     * @param user      The user request to put into the request tree.
     * @param user      The user request to put into the active user tree.
     *
     * @return User instance.
     *
@@ -104,6 +104,20 @@ public interface UserPersistence<T extends Principal>
        throws TransientException, AccessControlException,
               UserAlreadyExistsException;

    /**
     * Add the user to the pending user tree.
     *
     * @param user      The user request to put into the pending user tree.
     *
     * @return User instance.
     *
     * @throws TransientException If an temporary, unexpected problem occurred.
     * @throws AccessControlException If the operation is not permitted.
     */
    void addPendingUser(UserRequest<T> user)
        throws TransientException, AccessControlException,
        UserAlreadyExistsException;

    /**
     * Get the user specified by userID.
     *
+2 −0
Original line number Diff line number Diff line
@@ -980,6 +980,8 @@ public class LdapGroupDAO<T extends Principal> extends LdapDAO
    {
        try
        {
            // TODO Subject has the X500Principal, no need to go to ldap.
            // TODO X500Principal is optional???
            User<X500Principal> subjectUser =
                    userPersist.getX500User(getSubjectDN());
            if (subjectUser.equals(owner))
+138 −183

File changed.

Preview size limit exceeded, changes collapsed.

+33 −5
Original line number Diff line number Diff line
@@ -117,9 +117,9 @@ public class LdapUserPersistence<T extends Principal>
    }

    /**
     * Add the new user.
     * Add the user to the active user tree.
     *
     * @param user
     * @param user      The user request to put into the active user tree.
     *
     * @return User instance.
     *
@@ -145,6 +145,35 @@ public class LdapUserPersistence<T extends Principal>
        }
    }

    /**
     * Add the user to the pending user tree.
     *
     * @param user      The user request to put into the pending user tree.
     *
     * @return User instance.
     *
     * @throws TransientException If an temporary, unexpected problem occurred.
     * @throws AccessControlException If the operation is not permitted.
     */
    public void addPendingUser(UserRequest<T> user)
        throws TransientException, AccessControlException,
        UserAlreadyExistsException
    {
        LdapUserDAO<T> userDAO = null;
        try
        {
            userDAO = new LdapUserDAO<T>(this.config);
            userDAO.addPendingUser(user);
        }
        finally
        {
            if (userDAO != null)
            {
                userDAO.close();
            }
        }
    }

    /**
     * Get the user specified by userID.
     *
@@ -183,9 +212,8 @@ public class LdapUserPersistence<T extends Principal>
    * @throws TransientException     If an temporary, unexpected problem occurred.
    * @throws AccessControlException If the operation is not permitted.
    */
    public User<T> getPendingUser(final T userID) throws UserNotFoundException,
                                                         TransientException,
                                                         AccessControlException
    public User<T> getPendingUser(final T userID)
        throws UserNotFoundException, TransientException, AccessControlException
    {
        LdapUserDAO<T> userDAO = null;
        try
+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ public class CreateUserAction extends AbstractUserAction
    {
        final UserPersistence<Principal> userPersistence = getUserPersistence();
        final UserRequest<Principal> userRequest = readUserRequest(this.inputStream);
        userPersistence.addUser(userRequest);
        userPersistence.addPendingUser(userRequest);

        syncOut.setCode(201);
        logUserInfo(userRequest.getUser().getUserID().getName());
Loading