The Super Admin is the administrator of the entire system. It can be used in models such as RBAC, ABAC, and RBAC with domains. The detailed example is as follows:
r = sub, obj, act
p = sub, obj, act
e = some(where (p.eft == allow))
m = r.sub == p.sub && r.obj == p.obj && r.act == p.act || r.sub == "root"
This example illustrates that, with the defined
matchers, Casbin determines whether the request can match the policy. One important aspect is checking if the
sub is root. If the judgment is correct, authorization is granted, and the user has permission to perform all actions.
Similar to the root user in Linux systems, being authorized as root grants access to all files and settings. If we want a
sub to have full access to the entire system, we can assign it the role of Super Admin, granting the
sub permission to perform all actions.