Skip to Content
Nov 27, 2012 at 05:26 PM

Getting the rights for access levels


I'm working on a program that will provide documentation about various parts of the CMS - currently working in BO XI 3.1 sp5, but I will want to migrate this code to 4.0 as well. As part of this, I'd like to output all of the access levels (standard and custom) with their associated rights - the same info you see when you view the included rights for an access level in the CMC. I can get to the access level info, but it's not clear in the documentation how to get to the rights info. I'm very familiar with the .NET SDK, but this is something that's not available there, so I have to do it in Java which I've done just a little work with.

Here is the code I have so far:

String query = "Select * from CI_SYSTEMOBJECTS where SI_KIND='CustomRole'";

IInfoObjects iobjs = store.query(query);

if (iobjs.getResultSize() > 0){

Iterator<IInfoObject> iobjIt = iobjs.iterator();


ICustomRole role = (ICustomRole) obj;

ISecurityInfo2 si = role.getSecurityInfo2();

IPluginBasedRightIDs prights = si.getKnownRightsByPlugin();

//What to do from here?



What method do I use to get the list of rights: getMetaPluginRights(), getPluginCustomRights(), or getPluginRights()? Or do I have to use some combination of the three? If it's one of the latter two methods, how do I navigate the Map to get to the information I need?

Code samples would be greatly appreciated. Thanks!