Skip to Content
avatar image
Former Member

Display KM Resources in a table with Permission type

Hello Friends.

I am currently developing an application using web dynpro java on (NWDS 7.0 ehp1) to get the KM resources & collection of a user with the permission type (i,e. Read/Write/Full Controll etc) and display it on a table.

So I am able to get the name of the Resources & Collections of a user but I am unable to get the permission type.

Im not getting any help fom anywhere else. So can anyone please suggest me the way or example of code to get that.

Thanks

Mainak

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 17, 2012 at 11:56 AM

    Mainak

    To get the permissions, you will have to use the ACL Manager , ACL Entry APIs provided by the RF framework.

    For a resource, you get the aclmanager and resourceacl...from there, you can get the ACL entries.

    A sample code could be

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

              if (sm != null && sm instanceof IAclSecurityManager) {

                   IAclSecurityManager asm = (IAclSecurityManager) sm;

                   IResourceAclManager ram = asm.getAclManager();

                   IResourceAcl ra = ram.getAcl(resource);

                   if (ra == null) {

                        ra = ram.getInheritedAcl(resource);

                   }

    IResourceAclEntryListIterator aclList = ra.getEntries().iterator();

    Check the javadocs apis as well

    http://help.sap.com/javadocs/NW04S/current/km/com/sapportals/wcm/repository/security/IResourceAclManager.html

    Sandip

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sandip,

      I have done the coding part but when I am going to get that I am not getting any option for permission.

      Lik my code is :

      resourcesUserElement.setPermissionType(tempResources.get****** "Here I am not getting any appropriate option for permission").

      Can u please suggest me ?