If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Show permission on package

Started by clowicek, 14 Jun 2012 09:40:06 AM

Previous topic - Next topic

clowicek

Hello,
i have question about show permission on package... i have java sdk application that show me all package on public folder... and now i need show package name and permission information (user/group/role and permission - Read/Write etc). I don't know how show permission information... can you help me :)

Thank you

Stepan

murali999

#1
Hi Stepan,

Try the below code it will give you the all accesspermissions assigned to the object

BaseClass [] package = cmService.query(); // Query method for getting the package
Policy[] existingPolicie = packages[0].getPolicies().getValue();
for(int j=0;j<existingPolicies.length;j++)
{
Permission[] p=existingPolicies[j].getPermissions();

PropEnum[] props2 = new PropEnum[] {PropEnum.searchPath, PropEnum.defaultName };
SearchPathMultipleObject spmo2 = new SearchPathMultipleObject();
spmo2.set_value(existingPolicies[j].getSecurityObject().getSearchPath().getValue());

BaseClass[] secobj = cmService.query(spmo2, props2, sort,QueryOptions);

if(secobj !=null && secobj.length>0)
{
           System.out.println(
                             secobj[0].getDefaultName().getValue() +" has the below access permissions");

         for(int k=0;k<p.length;k++)
        {
                               System.out.print(p[k].getName() +"  : ");
                               System.out.println(p[k].getAccess());
                      }
             }
}


Regards,
Murali

RA:
Placed code between code-tags.