Get Started
التثبيت
go get github.com/casbin/casbin/v3
Migrating from v2 to v3
If you're upgrading from Casbin v2 to v3, update your import paths from github.com/casbin/casbin/v2 to github.com/casbin/casbin/v3. This applies to all subpackages as well (e.g., v2/model becomes v3/model).
For Go modules, run:
go get -u github.com/casbin/casbin/v3
Then update all imports in your code from /v2 to /v3.
لـ Maven:
<!-- https://mvnrepository.com/artifact/org.casbin/jcasbin -->
<dependency>
<groupId>org.casbin</groupId>
<artifactId>jcasbin</artifactId>
<version>1.x.y</version>
</dependency>
GraalVM Native Image Support
If you're building a native application with GraalVM (e.g., using Quarkus or Spring Native), jCasbin requires special configuration due to its use of the Aviator expression engine.
By default, Aviator uses dynamic class generation via ASM, which is not supported in GraalVM native images. To resolve this, you must configure Aviator to use interpreter mode instead of compilation mode.
For Quarkus applications
Add the following to your application.properties or pom.xml:
<properties>
<quarkus.native.additional-build-args>
-J-Daviator.eval.mode=INTERPRETER
</quarkus.native.additional-build-args>
</properties>