Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
permissionsinfo list display
Bhargav Coca
I am trying to Print out all the users who have access to a given branch. I do get list with lot of addendum, I am trying to scrape out the things i do not want and it is no going away. Here is the snippet which prints it.
I am doing a standard getting branch info and passing it to a method.
CSBranch csbranch = csclient.getBranch(csvpath.getBranch(), true);
this is my method
[html]
public void getPermissionInfo(CSBranch csbranch) {
CSPermissionInfo[] permissioninfo;
try {
System.out.println("You are inside");
permissioninfo = csbranch.getPermissionInfo(false, true);
if (null == permissioninfo) {
System.out.println("\t(branch has no roles assigned)");
} else {
for (int i = 0; i < permissioninfo.length; i++) {
CSPermissionEntry[] permissionentries = permissioninfo
.getPermissionEntries();
for (int j = 0; j < permissionentries.length; j++) {
CSPrincipal csprincipal = permissionentries.getPrincipal();
System.out.println("\t" + csprincipal.getName());
}
}
}
} catch (CSException e) {
System.err.println("Unable to get permission info for this branch");
e.printStackTrace();
}
}
[/html]
I just need csprincipal.getName(); to get all the list of users who have access to this particular branch, i do not want anything else.
I am getting role information email address and stuff not needed, how can i scrape this out?
Thanks
Find more posts tagged with
Comments
Bhargav Coca
I do not see a method which I can use of the csbranch object which gives me the groups which have access to the Branch. There is no getGroup() method in csbranch.
Thanks