Operation advisor question
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
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
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
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
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 :)
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!
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!
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.
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.