Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Deleting users (non-LDAP Tomcat) in RTC 4.x?

I see several folks have asked about this in the distant past, but it looks like it's been a year since it was last asked and I could swear the ability to delete users was added at some point.

We have a large number of users created back in RTC 2.x that had bad user IDs. These accounts were never actually used - have no work items or source artifacts associated with them - and thus there should not be any risk in removing them completely. I also wrote an app that uses the API to spit out a list of archived user accounts that don't own any work items or source artifacts, just to be sure.

We are using Tomcat with manually added IDs, not using LDAP. I know how to CHANGE user IDs, but we need to delete them as we long ago created good IDs to replace the bad ones.

1 vote

Comments

There is no Delete User function.



One answer

Permanent link
Mike, I am not aware of a delete user function. In the web UI, you can archive users and get them out of the way.
I checked the repotools and there is also only the capability to archive the users exposed to users.
I can only imagine that the reason for this is that users could be potentially referenced at all kinds of places and deleting users could cause dangling references in many places.

There is an API call that allows to delete users, and it could be used, however, I am not sure if that could have bad consequences, should a user ID actually be referenced from other repository artifacts.

0 votes

Comments

Can it be done with the REST API or does it require the Java API?

Since I am checking connections myself before deleting, I am not worried about breaking things. The report takes a long time to run since it checks ownership of 50,000 work items and all SCM and Build artifacts, but it does the job. These are "unused" user accounts.

Mike, I have not tried REST. I found teamRepository.contributorManager().deleteContributor(contributorHandle, monitor) in the Plain Java Client Libraries. You could use this easily by modifying the code from http://rsjazz.wordpress.com/2012/10/12/changing-the-jazz-user-id-using-the-rtc-plain-java-client-libraries/. The code is available for download from the post. You would just only have to change very few lines e.g. add a new method

    public static void deleteUserID(ITeamRepository teamRepository,
            String originalID, String newID, Boolean doUpdate, IProgressMonitor monitor)
            throws TeamRepositoryException {
        System.out.print("Delete user: " + originalID + (doUpdate ? "" : " - Simulation"));
        IContributor user = teamRepository.contributorManager()
                .fetchContributorByUserId(originalID, monitor);
        if (doUpdate) {
            teamRepository.contributorManager().deleteContributor(user, monitor);
        }
        System.out.println(" - OK");
    }

and replace the call to the other method by the call to the new method.

Mind the risk 8-)

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 30
× 27

Question asked: Jan 06 '14, 5:14 p.m.

Question was seen: 5,765 times

Last updated: Jan 08 '14, 3:01 a.m.

Confirmation Cancel Confirm