setPublicAccess: Add a Rule to the AccessPolicy to make the object publicly...

Description Usage Arguments Value See Also Examples

Description

To be called prior to creating the object in DataONE. When called before creating the object, adds a rule to the access policy that makes this object publicly readable. If called after creation, it will only change the system metadata locally, and will not have any effect on remotely uploaded copies of the DataObject.

Usage

1
2
3
4
5
6
7
setPublicAccess(x, ...)

## S4 method for signature 'DataObject'
setPublicAccess(x)

## S4 method for signature 'DataPackage'
setPublicAccess(x, identifiers = list())

Arguments

x

DataObject

...

(not yet used)

identifiers

A list of character values containing package member identifiers that will be updated (default is all package members).

Value

A DataObject with modified access rules.

A DataPackage with modified access rules.

See Also

DataObject-class

DataObject-class

DataPackage-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data <- charToRaw("1,2,3\n4,5,6\n")
do <- new("DataObject", "id1", dataobj=data, "text/csv", 
  "uid=jones,DC=example,DC=com", "urn:node:KNB")
do <- setPublicAccess(do)
# First create a sample package with two DataObjects
dp <- new("DataPackage")
data <- charToRaw("1,2,3\n4,5,6\n")
obj <- new("DataObject", id="id1", dataobj=data, format="text/csv")
dp <- addMember(dp, obj)
data2 <- charToRaw("7,8,9\n4,10,11\n")
obj2 <- new("DataObject", id="id2", dataobj=data2, format="text/csv")
dp <- addMember(dp, obj2)
# Now add public read to all package members ("id1", "id2")
dp <- setPublicAccess(dp)

datapack documentation built on Aug. 29, 2017, 5:08 p.m.