Learn R Programming

datapack (version 1.0.0)

hasAccessRule: Determine if a particular access rules exists within SystemMetadata.

Description

Each SystemMetadata document may contain a set of (subject, permission) tuples that represent the access rules for its associated object. This method determines whether a particular access rule already exists within the set.

Usage

hasAccessRule(x, ...)
"hasAccessRule"(x, subject, permission)

Arguments

x
the SystemMetadata instance to which to add the rules
...
Additional arguments
subject
the subject of the rule to be checked
permission
the permission to be applied to subject if x is character

Value

A logical value: if TRUE the access rule was found, if FALSE it was not found.boolean TRUE if the access rule exists already, FALSE otherwise

See Also

SystemMetadata-class

Examples

Run this code
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)
ruleExists <- hasAccessRule(sysmeta, subject="uid=smith,ou=Account,dc=example,dc=com", 
  permission="write")

Run the code above in your browser using DataLab