Hibernate Adapter for JCasbin

Load policy from Hibernate or save policy to it

License

License

Categories

Categories

Hibernate Data ORM
GroupId

GroupId

org.casbin
ArtifactId

ArtifactId

hibernate-adapter
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Hibernate Adapter for JCasbin
Load policy from Hibernate or save policy to it
Project URL

Project URL

https://github.com/jcasbin/hibernate-adapter
Source Code Management

Source Code Management

https://github.com/jcasbin/hibernate-adapter

Download hibernate-adapter

How to add to project

<!-- https://jarcasting.com/artifacts/org.casbin/hibernate-adapter/ -->
<dependency>
    <groupId>org.casbin</groupId>
    <artifactId>hibernate-adapter</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.casbin/hibernate-adapter/
implementation 'org.casbin:hibernate-adapter:1.0.1'
// https://jarcasting.com/artifacts/org.casbin/hibernate-adapter/
implementation ("org.casbin:hibernate-adapter:1.0.1")
'org.casbin:hibernate-adapter:jar:1.0.1'
<dependency org="org.casbin" name="hibernate-adapter" rev="1.0.1">
  <artifact name="hibernate-adapter" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.casbin', module='hibernate-adapter', version='1.0.1')
)
libraryDependencies += "org.casbin" % "hibernate-adapter" % "1.0.1"
[org.casbin/hibernate-adapter "1.0.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.casbin : jcasbin jar 1.1.0
org.hibernate : hibernate-core jar 5.3.7.Final

test (3)

Group / Artifact Type Version
junit : junit jar 4.11
mysql : mysql-connector-java jar 5.1.46
com.microsoft.sqlserver : mssql-jdbc jar 8.2.2.jre8

Project Modules

There are no modules declared in this project.

hibernate-adapter

codebeat badge GitHub Actions Coverage Status javadoc Maven Central Gitter

Load policy from Hibernate or save policy to it.

Usage

First, Introduce it in the pom.xml:

<dependency>
    <groupId>org.casbin</groupId>
    <artifactId>hibernate-adapter</artifactId>
    <version>1.0.0</version>
</dependency>

Then you can use it in your project like this:

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
org.casbin

jCasbin

jCasbin authorization library and the official middlewares

Versions

Version
1.0.1
1.0.0