Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 2 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 (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-14T01:18:37.000Z (12 months ago)
- Last Synced: 2024-01-15T02:57:59.726Z (12 months 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
[![codebeat badge](https://codebeat.co/badges/4bd94027-fdd2-4b11-b894-89785bf542b3)](https://codebeat.co/projects/github-com-jcasbin-hibernate-adapter-master)
[![GitHub Actions](https://github.com/jcasbin/hibernate-adapter/workflows/build/badge.svg)](https://github.com/jcasbin/hibernate-adapter/actions)
[![Coverage Status](https://coveralls.io/repos/github/jcasbin/hibernate-adapter/badge.svg?branch=master)](https://coveralls.io/github/jcasbin/hibernate-adapter?branch=master)
[![javadoc](https://javadoc.io/badge2/org.casbin/hibernate-adapter/javadoc.svg)](https://javadoc.io/doc/org.casbin/hibernate-adapter)
[![Maven Central](https://img.shields.io/maven-central/v/org.casbin/hibernate-adapter.svg)](https://mvnrepository.com/artifact/org.casbin/hibernate-adapter/latest)
[![Discord](https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2)](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