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)
while (iter.hasNext()) {
perm = iter.next();
if (perm.get_GranteeName().equals("orphaned SID here")){
iter.remove();
CEObject.save(RefreshMode.REFRESH);
break;
}
}
}
- Open an object store and create an object store search.
- On the SQL view tab, enter the following query:
SELECT TOP 100 This FROM Document
- Select Enable bulk action on the bulk action tab.
- In the Script section, click Run script.
- 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();
while (iter.hasNext()) {
perm = iter.next();
if (perm.get_GranteeName().equals("orphaned SID here")){
iter.remove();
CEObject.save(RefreshMode.REFRESH);
break;
}
}
}
- Click Run. The administration console runs the query and the JavaScript action.
- 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"}}]
Was this topic helpful?
Document Information
Modified date:
26 July 2021
UID
swg21968295