Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Cannot Assign Permission Owner to a Collection

Dear All

I have a whole of folders in KM to which I want to assign a Portal Group as a permission owner depending on the folder.

Now I can <b>add permissions successfully</b> using the method <b>addEntry</b>

But when I <b>add a Permission owner, it fails to create a permission owner</b> for that folder and also throws a <b>null</b> error.

ISecurityManager sm = deptname.getRepositoryManager().getSecurityManager(deptname); // deptname is the iresource object
if(sm != null && sm instanceof IAclSecurityManager){
 IAclSecurityManager asm = (IAclSecurityManager)sm; 
 IResourceAclManager ram = asm.getAclManager();				    IResourceAcl ra = ram.createAcl(deptname);				    ra = ram.getInheritedAcl(deptname);
	    IUMPrincipal grp = WPUMFactory.getGroupFactory().getGroup("groupname");
	    IUMPrincipal grp2 = WPUMFactory.getUserFactory().getUser("prem");
	    ra.addEntry(ram.createAclEntry(grp, false, ram.getPermission(IAclPermission.ACL_PERMISSION_READ), 0));
                    ra.addOwner(grp2);

Actually I have to give <b>permission owner</b> rights to a user group, but even if I try to give it to a user as shown above, it fails.

The names of the users and groups are valid. The resourec context has a service user.

Former Member
replied

Hi,

try this:

ISecurityManager sm = deptname.getRepositoryManager().getSecurityManager(deptname); // deptname is the iresource object
if(sm != null && sm instanceof IAclSecurityManager){
 IAclSecurityManager asm = (IAclSecurityManager)sm; 
 IResourceAclManager ram = asm.getAclManager();	
 ram.removeAcl(deptname);		   
 IResourceAcl ra = ram.createAcl(deptname);			
 IUMPrincipal grp = WPUMFactory.getGroupFactory().getGroup("groupname");
 IUMPrincipal grp2 = WPUMFactory.getUserFactory().getUser("prem");
 ra.addOwner(grp2);

Best Regards,

Avishai Zamir

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question