10-27-2016 11:17 AM
I'm trying to use the JavaScript actions API to remove the cutoff on a record folder, and reopen the folder. A snippet of the code:
var uncutoffAction = actions.create("unCutoff"); | |
var openFolderAction = actions.create("openRecordFolder"); | |
uncutoffAction.execute(matches[0].nodeRef); | |
openFolderAction.execute(matches[0].nodeRef); |
This returns the following error:
2016-10-26 14:03:21,021 ERROR [extensions.webscripts.AbstractRuntime] [http-apr-8080-exec-175] Exception from executeScript - redirecting to status template error: 09262202 Failed to execute script 'workspace://SpacesStore/c398238a-138a-4917-b4db-0376da8671a6': 09262201 The user geofa does not have the permission to remove the protected aspect rma:cutOff from the node workspace://SpacesStore/e7abcb78-04bb-4e5b-ab82-e511d39bac69
org.alfresco.scripts.ScriptException: 09262202 Failed to execute script 'workspace://SpacesStore/c398238a-138a-4917-b4db-0376da8671a6': 09262201 The user geofa does not have the permission to remove the protected aspect rma:cutOff from the node workspace://SpacesStore/e7abcb78-04bb-4e5b-ab82-e511d39bac69
Currently, for development, I'm triggering the script, and I'm an administrator on the system, and in RM. I'm able to remove the cutoff manually using the action button in the share interface. I'm guessing that the "protected aspect" has something to do with my problem, but I cant find any documentation on it (and generally RM is much less documented than core Alfresco.)
Is there a workaround to make this work, or a step I'm missing?
10-27-2016 11:30 AM
How do you execute the javascript ? can you run it as admin?
10-27-2016 02:10 PM
Based on your error it seems error related to access right for the user with which you are trying to execute this script.
Apart from may be these actions are not allowed to be executed via script because RM module has many such restriction to maintain it's compliance and Record life cycles.
Hope you have gone through this article which has good description regarding all those actions.
https://community.alfresco.com/docs/DOC-5023-records-management-user-guide#w_recordcutoffinformation
10-28-2016 04:34 AM
It'll also be worth checking the user running the script has the correct RM role assigned: Define roles | Alfresco Documentation
10-28-2016 12:02 PM
The script is being run through the "rules" mechanism placed on a category inside of RM. As I understand it, that means that the script will run as the user that moves or changes the file that triggers the rule to run. In testing that is me, an administrator with full permission in the RM system. I am able to manually remove the cutoff using the "undo cutoff" button.
It seem in RM actions are run by the rmaction service, not the action service. Some RM actions seem to be fine running through the action service, but this one is not. Since rmaction is not exposed to javascript, we're looking at building a action that proxys an rm action, to let rm action do what magic it needs to do.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.