18 lines
337 B
Go
18 lines
337 B
Go
|
package abac
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
)
|
||
|
|
||
|
// Result of evaluating an ABAC policy
|
||
|
type PolicyDecision bool
|
||
|
|
||
|
type PolicyEngine interface {
|
||
|
EvaluatePolicy(ctx context.Context, userAttributes []Attribute, resourceAttributes []Attribute, action string) PolicyDecision
|
||
|
}
|
||
|
|
||
|
const (
|
||
|
Allow PolicyDecision = true
|
||
|
Deny PolicyDecision = false
|
||
|
)
|