IBM Support

JavaScript example of deleting an Access Control Entry from the Security of an object using bulk processing with Administration Console for Content Engine (ACCE)

Question & Answer


Question

JavaScript example of deleting an Access Control Entry from the Security of an object using bulk processing with Administration Console for Content Engine (ACCE).

Answer

In the Administration Console for Content Engine (ACCE) you can apply JavaScript bulk actions to the search results of an object store query.  This example shows how to delete an Access Control Entry from the security of an object using bulk processing with Administration Console for Content Engine (ACCE)
  1. Open an object store and create an object store search.
  2. On the SQL view tab, enter the following query:

    SELECT TOP 100 This FROM Document
     
  3. Select Enable bulk action on the bulk action tab.
  4. In the Script section, click Run script.
  5. Copy the following JavaScript code and paste it into the Script field. Replace "orphaned SID here" with your user/group (ie. user@domain.com) or SID value.

    importPackage(Packages.com.filenet.api.core);
    importPackage(Packages.com.filenet.api.security);
    importClass(Packages.com.filenet.api.constants.RefreshMode);
    importClass(Packages.com.filenet.api.property.Properties);

    function OnCustomProcess (CEObject) {
        CEObject.refresh();
        var apl = CEObject.get_Permissions();
        var iter = apl.iterator();
        var perm = null;
       while (iter.hasNext()) {
          perm = iter.next();
          if (perm.get_GranteeName().equals("orphaned SID here")){
               iter.remove();
               CEObject.save(RefreshMode.REFRESH);
               break;
      }
        }
     }

 
  1. Click Run. The administration console runs the query and the JavaScript action.
  2. After the query runs, confirm that the specified user or group has been removed from the object's security.

[{"Product":{"code":"SSNVNV","label":"FileNet Content Manager"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Content Platform Engine","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"5.2.1;5.2.0","Edition":"All Editions","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
26 July 2021

UID

swg21968295