Quantcast
Channel: SCN : Popular Discussions - SAP Enterprise Portal: Content Management and Collaboration
Viewing all articles
Browse latest Browse all 1826

getAcl(resource) & getInheritedAcl(resource) both are returning NULL

$
0
0

Hello Everyone,

 

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

 

I am unable to get the 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


Viewing all articles
Browse latest Browse all 1826

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>