hasReservation {dataone}R Documentation

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 signature '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.

Details

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

Value

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

See Also

CNode class description.

Examples

## 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)

## End(Not run)

[Package dataone version 2.2.2 Index]