ข้ามไปยังเนื้อหาหลัก

Casbin RBAC vs. RBAC96

Casbin RBAC และ RBAC96

This document compares Casbin RBAC with RBAC96.

Casbin RBAC implements nearly all RBAC96 features while adding enhancements.

เวอร์ชัน RBACระดับการสนับสนุนคำอธิบาย
RBAC0รองรับอย่างเต็มที่RBAC0 provides basic RBAC96 functionality, defining relationships between Users, Roles, and Permissions.
RBAC1รองรับอย่างเต็มที่RBAC1 extends RBAC0 with role hierarchies. When alice has role1 and role1 has role2, then alice inherits role2 and its permissions.
RBAC2การจัดการที่เป็นอิสระต่อกันได้รับการสนับสนุน (เช่นนี้)RBAC2 adds constraints to RBAC0, enabling mutually exclusive policy handling. Quantitative limits are unsupported.
RBAC3การจัดการที่เป็นอิสระต่อกันได้รับการสนับสนุน (เช่นนี้)RBAC3 combines RBAC1 and RBAC2, supporting both role hierarchies and constraints. Quantitative limits are unsupported.

ความแตกต่างระหว่าง Casbin RBAC และ RBAC96

  1. Casbin handles User-Role distinction less strictly than RBAC96.

    Casbin treats both Users and Roles as strings. Consider this policy:

    p, admin, book, read
    p, alice, book, read
    g, amber, admin

    Calling GetAllSubjects() on a Casbin Enforcer:

    e.GetAllSubjects()

    returns:

    [admin alice]

    Casbin includes both Users and Roles as subjects.

    However, calling GetAllRoles():

    e.GetAllRoles()

    returns:

    [admin]

    Casbin distinguishes Users from Roles, but less strictly than RBAC96. Add prefixes like user::alice and role::admin to clarify relationships.

  2. Casbin RBAC offers more flexible permissions than RBAC96.

    RBAC96 defines seven permissions: read, write, append, execute, credit, debit, and inquiry.

    Casbin treats permissions as strings, letting you define permissions matching your requirements.

  3. Casbin RBAC รองรับโดเมน

    Casbin enables domain-based authorization, providing greater Access Control Model flexibility.