Skip to content

Commit a64886f

Browse files
committed
Bump to v0.1.0
1 parent a203a24 commit a64886f

File tree

2 files changed

+61
-61
lines changed

2 files changed

+61
-61
lines changed

README.md

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
SQLAlchemy Adapter for PyCasbin
2-
====
3-
4-
[![Build Status](https://www.travis-ci.org/pycasbin/sqlalchemy-adapter.svg?branch=master)](https://www.travis-ci.org/pycasbin/sqlalchemy-adapter)
5-
[![Coverage Status](https://coveralls.io/repos/github/pycasbin/sqlalchemy-adapter/badge.svg)](https://coveralls.io/github/pycasbin/sqlalchemy-adapter)
6-
[![Version](https://img.shields.io/pypi/v/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/)
7-
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/)
8-
[![Pyversions](https://img.shields.io/pypi/pyversions/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/)
9-
[![Download](https://img.shields.io/pypi/dm/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/)
10-
[![License](https://img.shields.io/pypi/l/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/)
11-
12-
SQLAlchemy Adapter is the [SQLAlchemy](https://www.sqlalchemy.org) adapter for [PyCasbin](https://github.com/pycasbin/sqlalchemy-adapter). With this library, Casbin can load policy from SQLAlchemy supported database or save policy to it.
13-
14-
Based on [Officially Supported Databases](http://www.sqlalchemy.org/), The current supported databases are:
15-
16-
- PostgreSQL
17-
- MySQL
18-
- SQLite
19-
- Oracle
20-
- Microsoft SQL Server
21-
- Firebird
22-
- Sybase
23-
24-
## Installation
25-
26-
```
27-
pip install casbin_sqlalchemy_adapter
28-
```
29-
30-
## Simple Example
31-
32-
```python
33-
import casbin_sqlalchemy_adapter
34-
import casbin
35-
36-
adapter = casbin_sqlalchemy_adapter.Adapter('sqlite:///test.db')
37-
38-
e = casbin.Enforcer('path/to/model.conf', adapter, True)
39-
40-
sub = "alice" # the user that wants to access a resource.
41-
obj = "data1" # the resource that is going to be accessed.
42-
act = "read" # the operation that the user performs on the resource.
43-
44-
if e.enforce(sub, obj, act):
45-
# permit alice to read data1casbin_sqlalchemy_adapter
46-
pass
47-
else:
48-
# deny the request, show an error
49-
pass
50-
```
51-
52-
53-
### Getting Help
54-
55-
- [PyCasbin](https://github.com/casbin/pycasbin)
56-
57-
### License
58-
59-
This project is licensed under the [Apache 2.0 license](LICENSE).
1+
SQLAlchemy Adapter for PyCasbin
2+
====
3+
4+
[![Build Status](https://www.travis-ci.org/pycasbin/sqlalchemy-adapter.svg?branch=master)](https://www.travis-ci.org/pycasbin/sqlalchemy-adapter)
5+
[![Coverage Status](https://coveralls.io/repos/github/pycasbin/sqlalchemy-adapter/badge.svg)](https://coveralls.io/github/pycasbin/sqlalchemy-adapter)
6+
[![Version](https://img.shields.io/pypi/v/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/)
7+
[![PyPI - Wheel](https://img.shields.io/pypi/wheel/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/)
8+
[![Pyversions](https://img.shields.io/pypi/pyversions/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/)
9+
[![Download](https://img.shields.io/pypi/dm/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/)
10+
[![License](https://img.shields.io/pypi/l/casbin_sqlalchemy_adapter.svg)](https://pypi.org/project/casbin_sqlalchemy_adapter/)
11+
12+
SQLAlchemy Adapter is the [SQLAlchemy](https://www.sqlalchemy.org) adapter for [PyCasbin](https://github.com/casbin/pycasbin). With this library, Casbin can load policy from SQLAlchemy supported database or save policy to it.
13+
14+
Based on [Officially Supported Databases](http://www.sqlalchemy.org/), The current supported databases are:
15+
16+
- PostgreSQL
17+
- MySQL
18+
- SQLite
19+
- Oracle
20+
- Microsoft SQL Server
21+
- Firebird
22+
- Sybase
23+
24+
## Installation
25+
26+
```
27+
pip install casbin_sqlalchemy_adapter
28+
```
29+
30+
## Simple Example
31+
32+
```python
33+
import casbin_sqlalchemy_adapter
34+
import casbin
35+
36+
adapter = casbin_sqlalchemy_adapter.Adapter('sqlite:///test.db')
37+
38+
e = casbin.Enforcer('path/to/model.conf', adapter, True)
39+
40+
sub = "alice" # the user that wants to access a resource.
41+
obj = "data1" # the resource that is going to be accessed.
42+
act = "read" # the operation that the user performs on the resource.
43+
44+
if e.enforce(sub, obj, act):
45+
# permit alice to read data1casbin_sqlalchemy_adapter
46+
pass
47+
else:
48+
# deny the request, show an error
49+
pass
50+
```
51+
52+
53+
### Getting Help
54+
55+
- [PyCasbin](https://github.com/casbin/pycasbin)
56+
57+
### License
58+
59+
This project is licensed under the [Apache 2.0 license](LICENSE).

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setuptools.setup(
99
name="casbin_sqlalchemy_adapter",
10-
version="0.0.3",
10+
version="0.1.0",
1111
author="TechLee",
1212
author_email="[email protected]",
1313
description="SQLAlchemy Adapter for PyCasbin",
@@ -16,7 +16,7 @@
1616
url="https://github.com/pycasbin/sqlalchemy-adapter",
1717
keywords=["casbin", "SQLAlchemy", "casbin-adapter", "rbac", "access control", "abac", "acl", "permission"],
1818
packages=setuptools.find_packages(),
19-
install_requires=['casbin>=0.2', 'SQLAlchemy>=1.2.18'],
19+
install_requires=['casbin>=0.8.1', 'SQLAlchemy>=1.2.18'],
2020
python_requires=">=3.3",
2121
license="Apache 2.0",
2222
classifiers=[

0 commit comments

Comments
 (0)