Learn R Programming

datapack (version 1.0.0)

addAccessRule: Add access rules to the specified object.

Description

Add one or more access rules to the access policy of the specified object.

Usage

addAccessRule(x, ...)
"addAccessRule"(x, y, ...)
"addAccessRule"(x, y, ...)

Arguments

x
The object instance to which to add the rules
...
Additional arguments
  • permission The permission to be applied to subject if x is character (read, write, changePermission)
y
The subject of the rule to be added, or a data frame of subject/permission tuples

Value

the SystemMetadata object with the updated access policy.the DataObject with the updated access policy

See Also

SystemMetadata-class

Examples

Run this code
# Parameter "y" can be character string containing the subject of the access rule:
sysmeta <- new("SystemMetadata")
sysmeta <- addAccessRule(sysmeta, "uid=smith,ou=Account,dc=example,dc=com", "write")
accessRules <- data.frame(subject=c("uid=smith,ou=Account,dc=example,dc=com", 
  "uid=slaughter,o=unaffiliated,dc=example,dc=org"), permission=c("write", "changePermission"))
sysmeta <- addAccessRule(sysmeta, accessRules)
# Alternatively, parameter "y" can be a data.frame containing one or more access rules:
sysmeta <- addAccessRule(sysmeta, "uid=smith,ou=Account,dc=example,dc=com", "write")
accessRules <- data.frame(subject=c("uid=smith,ou=Account,dc=example,dc=com", 
  "uid=slaughter,o=unaffiliated,dc=example,dc=org"), permission=c("write", "changePermission"))
sysmeta <- addAccessRule(sysmeta, accessRules)
data <- charToRaw("1,2,3\n4,5,6\n")
obj <- new("DataObject", id="1234", data=data, format="text/csv")
obj <- addAccessRule(obj, "uid=smith,ou=Account,dc=example,dc=com", "write")

Run the code above in your browser using DataLab