Casbin Model - What is PERM and Example
Casbin is an authorization library that supports access control models like ACL, RBAC, ABAC for muti-language.
Before developing Casbin, it is necessary to understand the underlying basic model and how to configure a permission management model that suits your needs.
First, the casbin model are base on PERM (Policy, Request, Effect, Matchers) with following settings:
- sub (subject): The entity accessing the resource, such as a member, user, or device. It represents who is making the request.
- obj (object): The resource being requested, such as a feature, page, or folder. It represents what is being requested.
- act (action): The method or behavior of the request, such as publish, edit, view, disable, etc. It represents how the request is made.
- eft (effect): The result of the policy after defining the sub, obj, and act. It can be set as true, false, or null (indicating allow).
And further, it can be combined with roles to manage roles or multi-tenancy.
Next, we will explain the Casbin model. During the learning process, you can practice and operate in the Casbin official editor.
Continue Reading