According to https://doc.nuxeo.com/nxdoc/automation-scripting/#logout , Auth.Logout() can be called from JavaScript in an automation.
However, the Automation Scripting:
function run(input, params) { var doc; doc = Auth.LoginAs(input, {}); doc = Auth.Logout(doc); return doc; }
optionally called through an Automation Chain:
- Context.FetchDocument - javascript.AS_SetPerms2
called by an User Action chokes with
Caused by: java.lang.ClassCastException: Cannot cast jdk.nashorn.internal.runtime.Undefined to jdk.nashorn.api.scripting.ScriptObjectMirror at java.lang.invoke.MethodHandleImpl.newClassCastException(MethodHandleImpl.java:361) at java.lang.invoke.MethodHandleImpl.castReference(MethodHandleImpl.java:356) at jdk.nashorn.internal.scripts.Script$Recompilation$41$33972AA$\^eval\_.Logout(<eval>:817) at jdk.nashorn.internal.scripts.Script$Recompilation$45$28AA$\^eval\_$cu1$restOf.run(<eval>:6) at org.nuxeo.automation.scripting.internals.ScriptingOperationImpl$Runnable$$NashornJavaAdapter.run(Unknown Source)
Expected: behavior of code matching documented behavior
Notice: Auth.LoginAs works OK
Workaround; "export" authentication operations to Automation Chain, not Script.
Documentation error: it should be written
doc = Auth.Logout(doc, {});
- is related to
-
NXP-26526 Fix Document.BlockPermissionInheritance respecting Auth.LoginAs system user
- Resolved