cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with getting kM resource permissions

rami_reddy4
Participant
0 Kudos

Hello Experts,

Using below Web Dynpro Java code I am capturing all KM Resource groups & Permissions. But if the KM resource having only one group (Everyone group) I am  getting null value. I have tried to use getACL & getInheritedAcl methods but still I am getting null values.

I am unable to get the groups & permission when KM Resource having only Everyone group.

Please find the below webdynpro Java code.

---------------------------------------------------------------------------------------------------------------------------------------

serviceUser = (IUser)WPUMFactory.getServiceUserFactory().getServiceUser(Admin_Service_User);
IResourceContext resourceContext = new ResourceContext(serviceUser);

IResourceFactory resourseFactory = ResourceFactory.getInstance(); 

//RID rid = RID.getRID("/documents");  //documents folder having only Everyone group 

RID rid = RID.getRID("/documents/Content");  // Content fodler having only Everyone group

IResource resource = resourseFactory.getResource(rid, resourceContext);

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

if(null!= secMgr  && (secMgr instanceof IAclSecurityManager)) {
IResourceAclEntryListIterator rAclEntryList =null;
IResourceAclEntry rAclEntry = null;
IAclSecurityManager aclSecMgr = null;
IResourceAclManager rAclMgr = null;
IResourceAcl resAcl = null;
  
aclSecMgr = (IAclSecurityManager)secMgr;
rAclMgr = aclSecMgr.getAclManager();  
resAcl = rAclMgr.getAcl(resource);
  
wdComponentAPI.getMessageManager().reportSuccess("Get ACL:"+resAcl);    // getting null value
wdComponentAPI.getMessageManager().reportSuccess("Get Inherited ACL:"+rAclMgr.getInheritedAcl(resource)); // getting null value

      
if (null!= resAcl) {   
  for(rAclEntryList = resAcl.getEntries().iterator(); rAclEntryList.hasNext();) {       

     rAclEntry = rAclEntryList.next();
     
    IPrivateKM_ResourceView.IKmRootFolderPermissionsElement kmRootPermissions = wdContext.createKmRootFolderPermissionsElement();
    
  kmRootPermissions.setGroupName(rAclEntry.getPrincipal().getDisplayName());
  kmRootPermissions.setPermissions(rAclEntry.getPermission().getDescription());
  kmRootPermissions.setRootFolderPath(rid.getPath());
     
  wdContext.nodeKmRootFolderPermissions().addElement(kmRootPermissions);           
    }       
}    
   }

Any immediate response is very helpful and will be awarded with high points.

Thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

rami_reddy4
Participant
0 Kudos

Issue was closed.

Answers (0)