-
Notifications
You must be signed in to change notification settings - Fork 16
ABAC Model
John Kouraklis edited this page Feb 18, 2019
·
1 revision
Implementing ABAC (Attribute-Based Access Control) model, involves the introduction and set of additional attributes that suit your design.
In Casbin4D, you can implement ABAC using the following steps:
- Define a record to hold the necessary attributes
type
TABACRecord = record
Owner: string;
end;
- Instantiate and populate the record
var
...
rec: TABACRecord;
...
begin
...
rec.Owner='John';
...
end;
- Enforce the assertion by passing the
TypeInfo
ofTABACRecord
and the instancerec
...
outcome=casbin.enforce(['alice,data1,read'], TypeInfo(TABACRecord), rec);
...
Note: The names of the fields in the record should match the name of the attributes used in the model file