It's all about the answers!

Ask a question

Operation advisor question


Anita Jeyaraman (611) | asked Mar 16 '12, 11:02 a.m.
Hello,

I am new to RTC and am still learning the ropes. I am trying to write an operation advisor, and need to examine the credentials of the user performing the operation (to perform some access rights checks). Can someone please give me some pointers on how I can do this?

I examined the processArea object and it has calls to getAdministrators and getMembers, but I'm not sure where to go from there.

Thanks much!
AJ

9 answers



permanent link
sam detweiler (12.5k6189201) | answered Mar 16 '12, 11:05 a.m.
A user is a contributor in RTC..

make sure to look at the javadoc provided in 3.0.1..

Sam

permanent link
Martha (Ruby) Andrews (3.0k44051) | answered Mar 16 '12, 4:32 p.m.
JAZZ DEVELOPER
Hello,
I'm not sure I understand the information you are trying to obtain. In RTC, most access would be controlled by permissions, which the Process runtime can determine for you.
Have you seen this wiki page on working with Process?
https://jazz.net/wiki/bin/view/Main/TeamProcessDeveloperGuide

Martha
Jazz Developer, Process Team

Hello,

I am new to RTC and am still learning the ropes. I am trying to write an operation advisor, and need to examine the credentials of the user performing the operation (to perform some access rights checks). Can someone please give me some pointers on how I can do this?

I examined the processArea object and it has calls to getAdministrators and getMembers, but I'm not sure where to go from there.

Thanks much!
AJ

permanent link
juwandy susilo (2122) | answered Mar 19 '12, 12:17 a.m.

private void checkRoleId(AdvisableOperation operation){
IContributorHandle [] arrayOfMembers = operation.getProcessArea().getMembers();
IProcessServerService processServerService = getService(IProcessServerService.class);
for(IContributorHandle members : arrayOfMembers){
try {
IRole[] contributorRoles = processServerService.getServerProcess(operation.getProcessArea()).getContributorRoles( members, operation.getProcessArea());
for (IRole role : contributorRoles) {
System.out.println("--------- ROLE ID ------------" + role.getId());
}
} catch (TeamRepositoryException e) {
System.out.println("------NOT PROJECT MANAGER------------");
}
}
return projectManagerId;
}



may be this code could help :)

permanent link
Anita Jeyaraman (611) | answered Mar 19 '12, 11:06 a.m.
Thank you all for the very helpful answers.

Martha, I was trying to get at the logged in user (the contributor), so that I can examine his role and access rights. The requirement is to stop the operation from proceeding if there is a certain combination of role and custom attribute value. In all other situations, the operation would proceed.

Thanks Juwandy for the code snippet - it was very useful.

Also, could someone point me to the java docs for the server. I downloaded one for the client, but couldnt find any for the server. Do I just generate it myself from the code?? Please let me know, and again, thanks for the help!

permanent link
Ralph Schoon (61.1k33643) | answered Mar 23 '12, 4:43 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,

the javadoc for the server is included in the SDK. The API is not officially supported (in contrast to the Plain Java Client Libraries). Please follow the Extensions workshop to learn how to install the SDK.

permanent link
sam detweiler (12.5k6189201) | answered Mar 23 '12, 7:36 a.m.
Hi,

the javadoc for the server is included in the SDK. The API is not officially supported (in contrast to the Plain Java Client Libraries). Please follow the Extensions workshop to learn how to install the SDK.


I don't see the javadoc in the sdk..

sam

permanent link
Ralph Schoon (61.1k33643) | answered Mar 23 '12, 7:41 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Sam,

there is no Javadoc package, but if you follow the Extensions Workshop in the library and deploy the SDK according to it, you have access to the documentation which is included in the source. As good as Javadoc if you know how to get around with Java/plugin search. The best way to access the info is using the Eclipse PDE. I think I remember hearing that some users extracted Javadoc from it.

permanent link
sam detweiler (12.5k6189201) | answered Mar 23 '12, 7:45 a.m.
ah.. I use the sdk and have access to all the type and method info by object.. if that is what i call javadoc..

the missing link is knowing where to start..

permanent link
Ralph Schoon (61.1k33643) | answered Mar 23 '12, 7:54 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I agree. It is hard to find the ways through the API. I started with whatever I could find here in the forum and the WiKi. More than once the Unit tests in the SDK helped me to find the start of the thread...

I have the same issue with the Javadoc in the Plain Java Client Libraries.

Your answer


Register or to post your answer.