Syntax for Models
-
A model configuration (CONF) requires at minimum four sections:
[request_definition],[policy_definition],[policy_effect], and[matchers]. -
Models implementing Role-Based Access Control (RBAC) must additionally include a
[role_definition]section. -
Models requiring policy invariant enforcement for RBAC may optionally include a
[constraint_definition]section. -
Model configuration (CONF) files support comments. The
#symbol initiates a comment, treating all subsequent text on that line as commentary.
요청 정의
The [request_definition] section specifies the parameters passed to the e.Enforce(...) function.
[request_definition]
r = sub, obj, act
Here, sub, obj, and act represent the traditional access control triple: subject (requesting entity), object (target resource), and action (operation type). This format is customizable—use sub, act when resources needn't be specified, or sub, sub2, obj, act when two requesting entities are involved.