feat(aa): add the Kind struct to manage aa rules.
This commit is contained in:
parent
1333ec2025
commit
3b0944c615
23 changed files with 239 additions and 223 deletions
|
|
@ -10,10 +10,10 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
const tokMQUEUE = "mqueue"
|
||||
const MQUEUE Kind = "mqueue"
|
||||
|
||||
func init() {
|
||||
requirements[tokMQUEUE] = requirement{
|
||||
requirements[MQUEUE] = requirement{
|
||||
"access": []string{
|
||||
"r", "w", "rw", "read", "write", "create", "open",
|
||||
"delete", "getattr", "setattr",
|
||||
|
|
@ -41,7 +41,7 @@ func newMqueueFromLog(log map[string]string) Rule {
|
|||
return &Mqueue{
|
||||
RuleBase: newRuleFromLog(log),
|
||||
Qualifier: newQualifierFromLog(log),
|
||||
Access: Must(toAccess(tokMQUEUE, log["requested"])),
|
||||
Access: Must(toAccess(MQUEUE, log["requested"])),
|
||||
Type: mqueueType,
|
||||
Label: log["label"],
|
||||
Name: log["name"],
|
||||
|
|
@ -86,6 +86,6 @@ func (r *Mqueue) Constraint() constraint {
|
|||
return blockKind
|
||||
}
|
||||
|
||||
func (r *Mqueue) Kind() string {
|
||||
return tokMQUEUE
|
||||
func (r *Mqueue) Kind() Kind {
|
||||
return MQUEUE
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue