It's all about the answers!

Ask a question

Web client api to know the permissions of the logged in user


Sharoon Shetty Kuriyala (55133) | asked Dec 11 '09, 5:01 a.m.
JAZZ DEVELOPER
Hi,

Is there an api which gives the permissions of the logged in user i.e. JazzAdmins, JazzProjectAdmins or JazzUsers.

Thanks,
Sharoon

3 answers



permanent link
Mike Pawlowski (6861) | answered Dec 14 '09, 1:35 p.m.
JAZZ DEVELOPER
Hi Sharoon,

As discussed offline, the utility you are using is used in the Admin application. It works fine for me in the Jazz Foundation 2.0 (3.0) code base. One way to verify whether it works is by logging in as ADMIN (and then as a normal user) and visiting a user's profile.
e.g.
https://jazz.net/jazz/web/projects/Rational%20Team%20Concert#action=com.ibm.team.repository.viewUserProfile&itemId=_-jW-gLiMEduHfMLg-NAVCg

Only Admins will have the power to edit the "Repository Permissions" check boxes.

If there is indeed a problem, you will need to file a bug against the Repository component in Jazz Foundation.

permanent link
Sharoon Shetty Kuriyala (55133) | answered Dec 14 '09, 7:58 a.m.
JAZZ DEVELOPER
Hi Mike,

We were using
com.ibm.team.repository.web.ui.internal.Util.userIsAdmin()
till RTC 2.0.0.1, this doesnt seem to give the expected results in RTC 2.0.0.2.

Sharoon

Hi Sharoon,

I'm aware of some internal services that might help you out.
I'm not sure about API. Somebody from the repository team will have to answer that.

There is a service to get all available roles:
com.ibm.team.repository.web.client.internal.AdminClient.getAllRoles(...)
e.g.
https://jazz.net/jazz/service/com.ibm.team.repository.service.internal.IAdminRestService/allRoles

There is a service to get contributor details on a particular user (including their roles):
com.ibm.team.repository.web.client.internal.AdminClient.getContributorByUUID(...)
e.g.
https://jazz.net/jazz/service/com.ibm.team.repository.service.internal.IAdminRestService/contributorByUUID?uuid=_-jW-gLiMEduHfMLg-NAVCg

There is a utility method to get the item ID for the currently logged in user:
com.ibm.team.repository.web.client.session.getAuthenticatedContributor().itemId

HTH

Mike

permanent link
Mike Pawlowski (6861) | answered Dec 11 '09, 10:59 a.m.
JAZZ DEVELOPER
Hi Sharoon,

I'm aware of some internal services that might help you out.
I'm not sure about API. Somebody from the repository team will have to answer that.

There is a service to get all available roles:
com.ibm.team.repository.web.client.internal.AdminClient.getAllRoles(...)
e.g.
https://jazz.net/jazz/service/com.ibm.team.repository.service.internal.IAdminRestService/allRoles

There is a service to get contributor details on a particular user (including their roles):
com.ibm.team.repository.web.client.internal.AdminClient.getContributorByUUID(...)
e.g.
https://jazz.net/jazz/service/com.ibm.team.repository.service.internal.IAdminRestService/contributorByUUID?uuid=_-jW-gLiMEduHfMLg-NAVCg

There is a utility method to get the item ID for the currently logged in user:
com.ibm.team.repository.web.client.session.getAuthenticatedContributor().itemId

HTH

Mike

Your answer


Register or to post your answer.