Skip to content

Commit 78e92b5

Browse files
committed
docs: update enforcer docstring to clarify functionality and usage
1 parent 7a5dfff commit 78e92b5

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

openedx_authz/engine/enforcer.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
"""
2-
Extended Casbin enforcer with watcher integration.
2+
Core authorization enforcer for Open edX AuthZ system.
3+
4+
Provides a Casbin FastEnforcer instance with extended adapter for database policy
5+
storage and Redis watcher for distributed policy synchronization.
6+
7+
Components:
8+
- enforcer: Main FastEnforcer instance for policy evaluation
9+
- adapter: ExtendedAdapter for filtered database policy loading
10+
- watcher: Redis-based watcher for real-time policy updates
11+
12+
Usage:
13+
from openedx_authz.engine.enforcer import enforcer
14+
allowed = enforcer.enforce(user, resource, action)
15+
16+
Requires `CASBIN_MODEL` setting and Redis configuration for watcher functionality.
317
"""
418

519
import logging

0 commit comments

Comments
 (0)