Registry / database / casbin-gorm-adapter-v3

casbin-gorm-adapter-v3

JSON →
library3.28.0gogounverified

GORM adapter for Casbin, enabling policy storage in relational databases via GORM.

go get github.com/casbin/gorm-adapter/v3
INSTALL
IMPORT
SIG · CASBIN-GORM-ADAPTE
C
casbin-gorm-adapter-v3
databasegov3.28.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gormadapter
github.com/casbin/gorm-adapter/v3

Initialize Casbin enforcer with GORM adapter

package main import ( "github.com/casbin/casbin/v2" "github.com/casbin/gorm-adapter/v3" "gorm.io/driver/sqlite" "gorm.io/gorm" ) func main() { db, _ := gorm.Open(sqlite.Open("test.db"), &gorm.Config{}) a, _ := gormadapter.NewAdapterByDB(db) e, _ := casbin.NewEnforcer("model.conf", a) _ = e }
Debug
Known issues
breakingBreaking changes between v2 and v3 adapter APIs
fix
Use v3 adapter with Casbin v2; check migration guide
affects: >=3.0.0 <4.0.0
Upgrade
Version history
3.28.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
36 hits · last 30 days
node
34
OpenAI (training)
1
Resources
casbin-gorm-adapter-v3 — go get casbin-gorm-adapter-v3 · libregistry