Web client api to know the permissions of the logged in user
3 answers
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
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
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
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
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.
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.