hasReservation function

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

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

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

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.

Returns

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.

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)

See Also

CNodeclass description.

  • Maintainer: Matthew B. Jones
  • License: Apache License 2.0
  • Last published: 2022-06-10