dataone (version 2.2.1)

hasReservation: Checks to determine if the supplied subject is the owner of the reservation of id.

Description

The hasReservation method checks the reservation of an identifier that has previously been reserved with the reserveIdentifier method. The identifier must have been reserved by the specified DataONE user identity (subject).

Usage

hasReservation(x, ...)

# S4 method for CNode hasReservation(x, pid, subject = as.character(NA))

Arguments

x

A CNode instance.

...

Additional parameters.

pid

The identifier that is being checked for existing as a reserved identifier or is in use as an identifier for an existing object

subject

The subject of the principal (user) that made the reservation.

Value

A logical value where TRUE means a reservation exists for the specified pid by the subject.

Details

To determine the DataONE identity that is currently being used for DataONE authentication, use the echoCredentials method.

See Also

CNode class description.

Examples

Run this code
# NOT RUN {
library(dataone)
cn <- CNode("STAGING")
creds <- echoCredentials(cn)
subject <- creds$person$subject
# Previously reserved pid (using reserveIdentifeir()), e.g. DOI or uuid
pid <- "urn:node:e27bb4f3-96bb-4af4-8902-f5914def077c"
hasRes <- hasReservation(cn, pid, subject=subject)
# }

Run the code above in your browser using DataLab