FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Apr 27, 2016, 9:49 AM
20 Posts

Readers and Authors in REST api

  • Category: APIs
  • Platform: Windows
  • Release: All
  • Role: Developer
  • Tags: REST,DDS,Readers,Authors
  • Replies: 2
I am building a Javascript Web application with a Domino back end, using the Domino DDS REST api to do POST, PUT, and GET operations against the database.  I want to use Authors and Readers fields in documents to control which users can see which documents and to give users with Author access in the ACL  the ability to edit documents they have created.  When doing a POST of a new document (implemented by the save() method of a new Backbone model) is there a way to designate one or more fields as Readers or Authors? 
Doing a GET on an existing document returns a JSON object with an attribute named '@authors' containing the names and roles in the Authors fields.  Is this attribute read/write?
Can I populate @authors with the desired values before doing a POST to have these values control author access?
My colleague says the Domino REST api makes no provision for setting Authors and Readers fields, and that this functionality can only be done through Java servlets.  Is this right?
Apr 27, 2016, 10:17 AM
26 Posts
If you use a form for your post
and set the option computewithform=true and the field you are assigning names to is reader/author etc It should take on the type author or reader.
May 4, 2016, 2:17 PM
589 Posts
hmm

The built in REST API is a little limiting for sure.

I do think there's a few more options then just "Java Servlets" - and I'm not exactly sure what your colleague is actually talking about there.  I guess you can do actual Java servlets somehow in the classic domino web programming.

But with XPages you could pull off you're own API a couple different ways.  There's some build in controls in the Ext. Library that let's you get a handle on things.  Another means would be in creating "XAgents".  That's pretty well documented I think.  Also with Java inside the .nsf you can create an actual Servlet - which is really an XAgent without the UI Component for the most part.  That's been blogged about lately- especially by Eric McCormick I believe.

So there should be several options available to you.

 

 


FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.