Technical Blog Post
Abstract
JavaScript example of changing the inheritable depth of a permission (ACE) entry for an object using bulk processing functionality in the Administration Console for Content Engine (ACCE)
Body
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 change the inheritable depth of a permission (ACE) entry for an object using bulk processing with Administration Console for Content Engine (ACCE).
The inheritable depth of an object can be set to the following
0 - No inheritance (this object only).
1 - This object and immediate children only.
-1 - This object and all children (infinite levels deep).
-2 - All children (infinite levels deep) but not this object.
-3 - Immediate children only; not this object.
In the Administration Console for Content Engine (ACCE) tool:
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 "Principal Name" with your user/group (ie. user@domain.com).
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()) {
var perm = iter.next();
if (perm.get_GranteeName().equals("Principal Name")){
perm.set_InheritableDepth(1);
apl.add(perm);
CEObject.set_Permissions(apl);
CEObject.save(RefreshMode.REFRESH);
break;
}
}
}
6. Click Run. The administration console runs the query and the JavaScript action.
7. After the query runs, confirm that the inheritable depth has been updated.
UID
ibm11280620