Webscripts: Using in read only mode

cancel
Showing results for 
Search instead for 
Did you mean: 
del007
Active Member II

Webscripts: Using in read only mode

I would like to ask if is it possible to use webscripts when alfresco (version 6.1) is in read-only mode?

I have webscipts (js) for document search and read. When alfresco is in read-only mode they doesn't work - I get a response "04150000 Access denied. The system is currently in read-only mode." Is it possible to make it wokring? My webscripts doesn't write any data to alfresco ...

Thank you

2 Replies
jeannette9728mi
Member II

Re: Webscripts: Using in read only mode

To @del007 ,

Alfresco restricts certain functionalities when in read-only mode to protect data integrity. Even read-only webscripts might trigger actions that could potentially violate this protection. For example, a seemingly simple document search script might internally perform permission checks or access control mechanisms that are restricted in read-only mode.

Try to Review your webscript code to ensure it doesn't attempt any actions that could modify data (e.g., creating or updating nodes, modifying properties). If your scripts are purely for reading data, you might be able to adjust permissions to allow them to function in read-only mode.

Consider alternative methods to achieve your goals during read-only periods. In some cases, you might be able to request an exemption for specific read-only webscripts from your Alfresco administrator.
This exemption would allow these scripts to function even when the system is in read-only mode. However, proceed with caution as this could introduce potential security risks.

I Recommend analyzing your webscripts to identify any data modification attempts, even indirect ones. If your scripts are truly read-only, explore adjusting permissions or using alternative approaches during read-only mode. Avoid requesting exemptions unless absolutely necessary, as they could compromise data security.

Best Regards,
MaximTimeClock
del007
Active Member II

Re: Webscripts: Using in read only mode

Thank you for your response. But I don't know how to change my webscript. I thing it should not write anything ...

I want to read a content of one concrete file:

model.dataString="\"crash\"";
 
function main(){
  var referenceType = "path";
  var reference = ["workspace", "SpacesStore", "Company Home","testAccessFile.txt"];
  var foundNode = search.findNode(referenceType, reference);
  if(foundNode!=null)  model.dataString="\""+foundNode.content+"\"";
}

main();

When alfresco is in read-only mode this script responds with a status of 500 and Access denied error