Rules are used in Deep to manage rights, such as the rights to Insert
/Update
/Delete
/Select
/Login
. More on this in the chapter Permissions .
The rules answer’s this question:
What Action
can the Subject
do with the Object
, where each of them are - Selectors.
Several of the coming steps duplicate those from Trees. If you did, you can use the links from there.
<TreesPreparationDuplication>
Let's prepare the types for a reproducible example.
<aside> ‼️ Attention! IDs may not match, as they are taken from different examples. Be careful with mutations.
</aside>
Insert type A
Insert type B=A|=>A
(insert type B where “from” link type could be only A, and “to” link type could be only A)
Insert type C=A|=>A
insert tree by types A
and B
, but not by C
insert links instances of types A
, B
and C
types, recreating scheme represented above
</TreesPreparationDuplication>
Suppose we need a rule:
<aside> 📍 User X (as Subject) has the rule toВ about A3 and below by Tree1 (as Object).
</aside>
We need to know Rule
, RuleSubject
, RuleObject
and RuleAction
IDs.
<aside> ❕ An example of the use of the legal system is discussed in the next chapter Permissions .
</aside>
Let's create a user. Formally, this can be any link, but for clarity, let's make a user.