I created a user Guest with Depositor rights. He can also Read and Write Public Documents. The test document I created has a field $PublicAccess with value "1". To open the document in the Guest XPage using a browser, I use this URL:
https:://domain/database.nsf/Guest.xsp?documentId=E696&action=editDocument
The page opens, the Summary field is filled from the document with ID=E696, but it stays read-only. If I add a 2nd dominoDocument that creates a new document, that field is editable, and clicking the Save button will save the data.
Is it possible to allow a Depositor to modify a Public document?
Here's my simple XPage:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.data>
<xp:dominoDocument var="document1" formName="ABC"></xp:dominoDocument>
<xp:dominoDocument var="document2" formName="XYZ" ignoreRequestParams="true"></xp:dominoDocument>
</xp:this.data>
Summary
<xp:br></xp:br>
<xp:inputText id="inputText1" value="#{document1.Summary}"></xp:inputText>
<xp:br></xp:br>
Code
<xp:br></xp:br>
<xp:inputText id="inputText2" value="#{document2.Code}"></xp:inputText>
<xp:br></xp:br>
<xp:br></xp:br>
<xp:button value="Save" id="button1">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<xp:saveDocument var="document2"></xp:saveDocument>
</xp:this.action>
</xp:eventHandler>
</xp:button>
</xp:view>
What I found out is that the presence of any valid non-empty Authors field (e.g. with a name or a role) will block edit access for Anonymous or a Depositor. My "solution" is to change the Authors property, by using setAuthors(false)
on every Authors field.