setAccess

0th

Percentile

Query and modify the Access Control List

These functions allow one to programmatically query and modify the access control list for a a Google document. These allows us to find out or specify who owns, can write, or read the document. We can also revoke permission.

Keywords
IO
Usage
setAccess(doc, ..., .perms = list(...), con = doc@connection) getAccess(doc, con = doc@connection) removeAccess(doc, who, con = doc@connection)
Arguments
doc
the GoogleDocumentDescription object or the name of a document. If this is just the name, con must be specified.
...
name = value pairs where name gives the type of access being granted and value is the identity of the person to whom it is being granted. value is typically an email address or 'everyone'.
.perms
this provides an alternative way to specify the type-who pairs rather than ... whch is more convenient for calling this function programmatically rather than interactively.
con
the authenticated Google connection. See getGoogleDocsConnection.
who
the identity of the user for who the permission is to be removed. This is an email address or 'everyone'.
Value

getAccess returns a character vector giving the type-who pairs.setAccess returns the updated access list.removeAccess returns the result of the HTTP request to remove the permissions. See parseHTTPHeader.

Note

For reasons I haven't got to the bottom of yet, setAccess() can return a value that is different from a subsequent call to getAccess(), yet that is precisely the call at the end of setAccess() with the same connection object! con = getGoogleDocsConnection() docs = getDocs(con) setAccess(docs$foo, writer = 'duncan@wald.ucdavis.edu', reader = 'everyone') owner writer reader "dtemplelang@gmail.com" "duncan@wald.ucdavis.edu" "everyone" getAccess(docs$TwoSheets, getGoogleDocsConnection()) owner reader "dtemplelang@gmail.com" "everyone"

References

http://code.google.com/apis/documents/docs/2.0/developers\_guide\_protocol.html#AccessControlLists

See Also

getDocs getGoogleDocsConnection

Aliases
  • setAccess
  • getAccess
  • removeAccess
Documentation reproduced from package RGoogleDocs, version 0.7-0, License: BSD

Community examples

Looks like there are no examples yet.