|Date tip published:||08/31/2010|
Developing XPages using Domino Designer 8.5
Using sessionAsSigner to allow Scripts Greater Access (XPages)
The code below on line one shows how to access the current database using sessionAsSigner. This uses the session global variable to access the current server name and file path. To access another database change the second parameter to the correct file path and file name. The remainder of the code creates a new document in the database, adds a field value to the document and saves it. If the session global variable was used instead of sessionAsSigner then the user would have to have at least Depositor or Author access in this database. Using sessionAsSigner, the user can be set to reader access in the ACL.
|1.||var curDB = sessionAsSigner.getDatabase(session.getServerName(),session.getCurrentDatabase().getFilePath());|
|2.||var doc = curDB.createDocument();|
|3.||doc.appendItemValue("testfield", "Some Data");|