It's all about the answers!

Ask a question

Couldn't get correct member role from "getContributorRoles" RCT API


Yi-Hung Lee (123) | asked Mar 10 '16, 10:47 p.m.
 In one of RCT projects.

We use "IRole[] roles = iClientProcess.getContributorRoles(member, iProcessArea, monitor);" to roles of member.
The problem is that 
1. Member has only one role in RTC
2. The API return 3 roles


member defined in RTC


RTC API Codes


Comments
Yi-Hung Lee commented Mar 11 '16, 3:43 a.m.

  Dear Ralph, 


Thank your feedback. But we not for the new adding user

Following are the additional information.
1. User-A with "Developer" role
2. Use "getContributorRoles" to get User-A's role and it feedback "Developer", "SD" and "SA"

This is our problem, they are existed users.

One answer



permanent link
Ralph Schoon (63.1k33645) | answered Mar 11 '16, 2:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
In my experience, the API is usually right and it is most likely an issue with the assumption of the user that is causing the difference.

If you add a user to a project/team area and assign them a role, the user actually has two roles already. The "default" or everyone role that anyone has as a member of the area, plus the role that you assign the user.

See https://jazz.net/library/article/291 and https://jazz.net/library/article/292 for more details.




Comments
Yi-Hung Lee commented Mar 11 '16, 3:40 a.m.

  Dear Ralph, 


Thank your feedback. But we not for the new adding user

Following are the additional information.
1. User-A with "Developer" role
2. Use "getContributorRoles" to get User-A's role and it feedback "Developer", "SD" and "SA"

This is our problem, they are existed users.


Yi-Hung Lee commented Mar 11 '16, 3:42 a.m.

  Dear Ralph, 


Thank your feedback. But we not for the new adding user

Following are the additional information.
1. User-A with "Developer" role
2. Use "getContributorRoles" to get User-A's role and it feedback "Developer", "SD" and "SA"

This is our problem, they are existed users.


Ralph Schoon commented Mar 11 '16, 5:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I can't comment on the information above. You can find some code getting role information in https://rsjazz.wordpress.com/2015/08/07/a-custom-condition-to-make-attributes-required-or-read-only-by-role-version-2/ and in some other posts on that blog.

In the Eclipse Client you can right click a project area and select "Create Runtime report" The exported HTML file should also tell you which users have which role in which context, should you be unsure.

Your answer


Register or 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.