isAuthorized {dataone} | R Documentation |
Test if the user identified by the provided token has authorization for operation on the specified object.
isAuthorized(x, ...)
## S4 method for signature 'D1Node'
isAuthorized(x, id, action)
x |
The node to send the request to. This is either a |
... |
(Not yet used) |
id |
The DataONE identifier (pid or sid) to check access for. |
action |
The DataONE action to check, possible values: "read", "write", "changePermission" |
The identifier parameter may be either a DataONE persistent identifier (pid) or series identifier (sid).
a logical, TRUE if the action is authorized, false if not.
CNode
class description.
## Not run:
# Send an authorization check to the D1 production CN.
cn <- CNode("PROD")
pid <- "doi:10.6073/pasta/7fcb8fea57843fae65f63094472f502d"
canRead <- isAuthorized(cn, pid, "read")
canWrite <- isAuthorized(cn, pid, "write")
canChange <- isAuthorized(cn, pid, "changePermission")
# Now send a check to a member node.
mn <- getMNode(cn, "urn:node:KNB")
pid <- "doi:10.6085/AA/pisco_recruitment.149.1"
canRead <- isAuthorized(mn, pid, "read")
canWrite <- isAuthorized(mn, pid, "write")
canChange <- isAuthorized(mn, pid, "changePermission")
## End(Not run)