Hello Axel,
thanks for your answer.
I'm using Alfresco Community 4.2.c in a vanilla installation on my development machine. No external database is attached; no modifications have been made. I also just re-installed Alfresco, just to make sure. No configs were touched.
I modified the source code as you suggested. On my developer machine, the script has only the following code:
<javascript>var courseNumber = document.properties.name.match(/^SPO_(\d{4,4})_/)[1];
var guest = guest;
var parentFolders = search.luceneSearch(
"@cm\\:title:\"" + courseNumber + " -* \" " +
"AND TYPE:\"cm:folder\"");
var oldFiles = search.luceneSearch(
"PARENT:" + parentFolders[0].properties.nodeRef + " " +
"AND @cm\\:name:\"SPO_" + courseNumber + "_*\"");
for (var i = 0; i != oldFiles.length; ++i) {
oldFiles.remove();
}</javascript>
However, the javascript debugger still says that "parentFolders" holds the mentioned error string, i.e. "A valid SecureContext was not provided in the RequestContext".
I noticed that the "companyHome" root object also has the same text, regardless of who the script runs, i.e., even the admin user gets this error message.
I'm absolutely clueless here. Is there any way I need to "log in" separately for the script to run?
TIA!
— Eric