Casbin

Casbin

  • Docs
  • API
  • Editor
  • JetBrains Plugin
  • Casdoor
  • Forum
  • OA
  • Trend
  • Help
  • Blog
  • Languages iconEnglish
    • 中文
    • 한국어
    • Русский
    • Français
    • 日本語
    • Help Translate
  • GitHub

›Extensions

The Basics

  • Overview
  • Get Started
  • How it Works
  • Tutorials

Model

  • Supported Models
  • Syntax for Models
  • Function
  • RBAC
  • RBAC with Domains
  • ABAC

Storage

  • Model Storage
  • Policy Storage
  • Policy Subset Loading

Extensions

  • Adapters
  • Watchers
  • Dispatchers
  • Role Managers
  • Middlewares

API

  • Management API
  • RBAC API

Advanced Usage

  • Multi-threading
  • Benchmarks
  • Performance Optimization

Management

  • Admin Portal
  • Casbin Service
  • Log & Error Handling
  • Online Editor
  • Frontend Usage

More

  • Our Adopters
  • Privacy Policy
  • Terms of Service
Edit

Dispatchers

Dispatcher provide a way to synchronize incremental changes of policy. It should be based on consistency algorithms such as raft to ensure the consistency of all enforcer instances. Through dispatcher users can easily establish distributed clusters.

The dispatcher's method is divided into two parts. The first is the method combined with casbin. These methods should be called inside casbin. Users can use the more complete api provided by casbin itself.

The other part is the method defined by the dispatcher itself, including the dispatcher initialization method, and different functions provided by different algorithms, such as dynamic membership, config changes etc.

note

we hope dispatcher just ensure the consistency of Casbin enforcer at runtime. So if the policy is inconsistent when initialization, the dispatcher will not work properly. Users need to ensure that the state of all instances is consistent before using dispatcher.

A complete list of Casbin dispatchers is provided as below. Any 3rd-party contribution on a new dispatcher is welcomed, please inform us and we will put it in this list:)

Go
DispatcherTypeAuthorDescription
Hashicorp Raft DispatcherraftCasbinDispatcher based on hashicorp/raft

DistributedEnforcer

DistributedEnforcer wraps SyncedEnforcer for dispatcher.

Go
    e, _ := casbin.NewDistributedEnforcer("examples/basic_model.conf", "examples/basic_policy.csv")
Last updated on 2/28/2021
← WatchersRole Managers →
Casbin
Docs
Getting StartedManagement APIRBAC APIMiddlewares
Community
Who's using Casbin?ForumStack OverflowProject Chat
Casbin          jCasbin
Node-Casbin   PHP-CasbinPyCasbin          Casbin.NETCasbin-CPP        Casbin-RS
Follow @CasbinNews
Copyright © 2021 Casbin contributors.