https://github.com/jcasbin/hibernate-adapter
Hibernete adapter for Casbin
https://github.com/jcasbin/hibernate-adapter
access-control adapter authorization casbin hibernate java jcasbin jdbc storage-driver
Last synced: 6 months ago
JSON representation
Hibernete adapter for Casbin
- Host: GitHub
- URL: https://github.com/jcasbin/hibernate-adapter
- Owner: jcasbin
- License: apache-2.0
- Created: 2020-07-12T01:49:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-14T01:18:37.000Z (over 1 year ago)
- Last Synced: 2024-01-15T02:57:59.726Z (over 1 year ago)
- Topics: access-control, adapter, authorization, casbin, hibernate, java, jcasbin, jdbc, storage-driver
- Language: Java
- Homepage: https://github.com/casbin/jcasbin
- Size: 36.1 KB
- Stars: 1
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hibernate Adapter for jCasbin
[](https://codebeat.co/projects/github-com-jcasbin-hibernate-adapter-master)
[](https://github.com/jcasbin/hibernate-adapter/actions)
[](https://coveralls.io/github/jcasbin/hibernate-adapter?branch=master)
[](https://javadoc.io/doc/org.casbin/hibernate-adapter)
[](https://mvnrepository.com/artifact/org.casbin/hibernate-adapter/latest)
[](https://discord.gg/S5UjpzGZjN)Load policy from [Hibernate](https://hibernate.org/orm/) or save policy to it.
## Usage
First, Introduce it in the pom.xml:```xml
org.casbin
hibernate-adapter
1.0.0```
Then you can use it in your project like this:
```java
Enforcer e = new Enforcer("examples/rbac_with_domains_model.conf");
Adapter adapter = new HibernateAdapter(DRIVER, URL, USERNAME, PASSWORD, true);
e.setAdapter(adapter);
e.loadPolicy();
```If you use Oracle, the last entry of the parameter must be set to `true`.
## Supported Databases
Currently supported databases:MySQL
Oracle
SQL Server 2012