Casbin

Casbin

  • 문서
  • API
  • 편집기
  • IDE Plugins
  • Single Sign-On (SSO)
  • Forum
  • 도움말
  • 블로그
  • Pricing
  • Contact Sales
  • Languages icon한국어
    • English
    • 中文
    • Русский
    • Français
    • Deutsch
    • 日本語
    • 번역 참여하기
  • GitHub

›모델

기초

  • 개요(Overview)
  • 시작하기
  • 작동 원리
  • 자습서

모델

  • 지원하는 접근 제어 모델
  • 모델(Model) 문법
  • Effector
  • 함수
  • RBAC
  • RBAC with Pattern
  • RBAC + 도메인
  • Casbin RBAC v.s. RBAC96
  • ABAC
  • Priority Model
  • Super Admin

저장소

  • 모델(Model) 저장
  • 정책(Policy) 저장
  • 정책(Policy) 부분 집합 불러오기

확장 기능

  • Enforcers
  • 어댑터
  • 감시자
  • Dispatchers
  • 역할(Role) 관리자
  • 미들웨어
  • GraphQL Middlewares
  • Cloud Native Middlewares

API

  • API Overview
  • Management API
  • RBAC API
  • RBAC with Domains API
  • RoleManager API
  • Data Permissions

고급 사용법 (Advanced usage)

  • 멀티 스레딩
  • 벤치마크
  • Performance Optimization
  • Authorization of Kubernetes
  • Authorization of Service Mesh through Envoy

관리

  • 관리자 포탈
  • Casbin 서비스
  • 로깅 및 오류 처리
  • Frontend Usage

Editor

  • 온라인 편집기
  • IDE Plugins

자세히

  • Casbin 적용 사례
  • Contributing
  • Privacy Policy
  • Terms of Service
Translate

Effector

Effect is the result of a policy rule. And the Effector is the interface for Casbin effectors.

MergeEffects()

MergeEffects merges all matching results collected by the enforcer into a single decision.

For example:

Go
Effect, explainIndex, err = e.MergeEffects(expr, effects, matches, policyIndex, policyLength)

In this example:

  • Effect is the final decision being merged by this function(Initialized as Indeterminate).
  • explainIndex is the index of eft which is Allow or Deny.(Initialized as -1)
  • err is used to check if the effect is supported.
  • expr is the policy effects stored as string
  • effects is the array of the Effect which can be Allow, Indeterminate or Deny
  • matches is the array showing that if the result is matching the policy.
  • policyIndex is the index of policy in the model.
  • policyLength is the length of the policy.

The code above illustrates how can we pass the parameters to the MergeEffects function and the function will process the effects and matches based on the expr

To deploy an Effector, we can do this:

Go
var e Effector
Effect, explainIndex, err = e.MergeEffects(expr, effects, matches, policyIndex, policyLength)

The basic idea of the MergeEffects indicates that if the expr can match the results which means that the p_eft is allow, then we can merge all effects at last. And if there are no deny rules are matched, then we allow.

note

If the expr can not match "priority(p_eft) || deny" and also the policyIndex is shorter than policyLength-1, it will short-circuit some effects in the middle.

← 모델(Model) 문법함수 →
Casbin
Docs
Getting StartedManagement APIRBAC APIMiddlewares
Community
Who's using Casbin?Stack Overflow
Casbin          jCasbin
Node-Casbin   PHP-CasbinPyCasbin          Casbin.NETCasbin-CPP        Casbin-RS
Follow @casbinHQ
Copyright © 2022 Casbin Organization