pipalia
pipalia

Reputation: 911

Xpages sessionAsSigner and domino datasource

I have a public document in a particular database which is created like this:

<xp:dominoDocument var="newDoc" formName="frmMyForm" 
    databaseName="#{javascript:applicationScope.aspMyDBPath}">
</xp:dominoDocument>

The ACL of that database is set to Anonymous as Reader with write access to public documents. I cannot save this document because Xpages is running as a web user. I could save it if I was running as agent signer and if I had initialised the database using sessionAsSigner. How can I do this with dominoDocument datasource? Any ideas?

Any help would be appreciated. I don't want to give Editor level access to this database just to get around this issue.

Upvotes: 1

Views: 1206

Answers (2)

Declan Lynch
Declan Lynch

Reputation: 3345

It should be possible to use a dataContext for this. In the properties of the XPage setup a new DataContext and set it to the correct DB/Doc but use sessionAsSigner to return the database.

You won't have the easy access to the fields on the form for any data controls, you'd need to manually enter in the EL for each field.

Upvotes: 1

Sven Hasselbach
Sven Hasselbach

Reputation: 10485

You can give users with no access to the database the possibility to create public documents this way:

  1. Add a form to your database with a $PublicAccess field (Text, value "1")
  2. Enable property "Is available for Public Access" of the form
  3. Add property "computewithform=both" to your datasource
  4. Change security settings of your Xpage to "Allow Public Access"
  5. Change DB's ACL and allow creating and reading of Public documents

This should work for readers too.

Hope this helps

Sven

Upvotes: 4

Related Questions