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

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

## S4 method for signature 'SystemMetadata'
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

1
2
3
4
5
6
7
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")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.