Skip to Content
3
Former Member
Feb 07, 2012 at 01:58 PM

Problem with getting permissions of KM documents with KM api

26 Views

Hello,

I'm developing application which is connected to KM file system and has to get permissions of a file. I'm using the following code:

wdUser = WDClientUser.getCurrentUser();

IUser user = wdUser.getSAPUser();

IResourceContext context = ResourceContext.getInstance(user);

RID ridFile = RID.getRID("/documents/Public Documents/IdM.pdf");

IResource resource;

resource = ResourceFactory.getInstance().getResource(ridFile, context);

// get Security Manager

ISecurityManager securityManager = resource.getRepositoryManager().getSecurityManager(resource);

// get ACLSecurity Manager

IResourceAclManager irm = ((IAclSecurityManager)securityManager).getAclManager();

// get ResourceAcl

IResourceAcl aclrec = irm.getAcl(resource);

The problem is that after getting IResourceAcl aclrec = irm.getAcl(resource); the variable aclrec is null. How can i get the ACL for a resource? I looked at an example for creating an acl at: http://forums.sdn.sap.com/thread.jspa?threadID=1983946 but getting of acl is kind of different task. Is there any way to activate ACL and get a real IResourceAcl not null?

Edited by: Teodor Tanev on Feb 7, 2012 3:10 PM