IBM Content Manager, Version 8.5           

Defining an access control list (ACL): Java™

  1. Define a new DKACLData object. A DKACLData class is used to hold ACL related data.
    DKACLData aclData1 = new DKACLData();
  2. Set the user group name for the ACL
    aclData1.setUserGroupName("ICMPUBLIC");
  3. Set ACL patron type.
    aclData1.setPatronType(DK_CM_USER_KIND_USER);
  4. Set the privilege set associated with this ACL
    aclData1.setPrivilegeSet(privSet_1);
  5. Retrieve and display information about the newly created ACL
    DKAccessControlListICM acl_1 = (DKAccessControlListICM)
    aclMgmt.retrieveAccessControlList("UserACL");
    System.out.println("ACL name  = " + acl_1.getName());
    System.out.println("    desc  = " + acl_1.getDescription());
    dkCollection coll = acl_1.listACLData();
    dkIterator iter = coll.createIterator();
    while (iter.more()) {
       DKACLData aclData = (DKACLData) iter.next();
       DKPrivilegeSetICM _privSet = (DKPrivilegeSetICM) 
          aclData.getPrivilegeSet();
       System.out.println("  PrivSet name  = " + _privSet.getName());
       System.out.println("  PrivSet desc  = " + _privSet.getDescription());
       System.out.println(" PrivSet scopeID = " + _privSet.getScopeID());
       System.out.println(" PrivSet application name = " + 
    			_privSet.getApplicationName());
       String usrGrpName = aclData.getUserGroupName();
       System.out.println("    UserGroupName = " + usrGrpName);
       short patronType = aclData.getPatronType();
       System.out.println("    Patron type   = " + patronType);
    }
  6. Set scope ID for this access control list.
    aclData1.setScopeID(2);
  7. Set application name for this access control list.
    aclData1.setApplicationName("applicationName");
  8. Create another DKACLData object.
    DKACLData aclData2 = new DKACLData();
    aclData2.setUserGroupName("ICMPUBLC");
    aclData2.setPatronType(DK_CM_USER_KIND_GROUP);
    aclData2.setPrivilegeSet(privSet_2);
  9. Create a new ACL. A DKAccessControlListICM represents a CM V8. ACL
    DKAccessControlListICM acl1 = new DKAccessControlListICM(ds);
  10. Assign a new name to the newly-created ACL
    acl1.setName("UserACL");
  11. Assign a description to the newly-created ACL
    acl1.setDescription("This is a user-defined ACL");
  12. Add the previously created ACL data objects to the ACL
    acl1.addACLData(aclData1);
    acl1.addACLData(aclData2);
    Important:

    If you update the ACL name in your language, the ACL name is updated for all the languages that are configured in IBM® Content Manager instead of the default language only.

  13. Add the newly-created ACL to the authorization manager, aclMgmt.add(acl1);

The complete sample program is in the samples directory.



Feedback

Last updated: December 2013
dcmcm104.htm

© Copyright IBM Corporation 2013.