canRead: Test whether the provided subject can read an object.

Description Usage Arguments Details Value See Also Examples

Description

Using the AccessPolicy, tests whether the subject has read permission for the object. This method is meant work prior to submission to a repository, and will show the permissions that would be enfirced by the repository on submission. Currently it only uses the AccessPolicy to determine who can read (and not the rightsHolder field, which always can read an object). If an object has been granted read access by the special "public" subject, then all subjects have read access.

Usage

1
2
3
4
canRead(x, ...)

## S4 method for signature 'DataObject'
canRead(x, subject)

Arguments

x

DataObject

...

Additional arguments

subject

: the subject name of the person/system to check for read permissions

Details

The subject name used in both the AccessPolicy and in the 'subject' argument to this method is a string value, but is generally formatted as an X.509 name formatted according to RFC 2253.

Value

boolean TRUE if the subject has read permission, or FALSE otherwise

See Also

DataObject-class

Examples

1
2
3
4
data <- charToRaw("1,2,3\n4,5,6\n")
obj <- new("DataObject", id="1234", data=data, format="text/csv")
obj <- addAccessRule(obj, "smith", "read")
access <- canRead(obj, "smith")


Search within the datapack package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.