Model Syntax
Every model CONF file must define these four sections: [request_definition], [policy_definition], [policy_effect], and [matchers].
- For RBAC, add a
[role_definition]section. - For RBAC with constraints (e.g. separation of duties), you can add
[constraint_definition]. - Lines starting with
#are comments; the rest of the line is ignored.
Request Definition
The [request_definition] section defines the parameters passed to e.Enforce(...).
[request_definition]
r = sub, obj, act
Here sub, obj, and act are the standard triple: subject, object, and action. You can change the format—e.g. sub, act when there is no resource, or sub, sub2, obj, act when two subjects are involved.