Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mkrd/Flask-Authorization
Simple user authorization to use alongside with Flask-Login
https://github.com/mkrd/Flask-Authorization
Last synced: 3 months ago
JSON representation
Simple user authorization to use alongside with Flask-Login
- Host: GitHub
- URL: https://github.com/mkrd/Flask-Authorization
- Owner: mkrd
- License: mit
- Created: 2019-11-29T06:12:10.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T23:41:30.000Z (over 1 year ago)
- Last Synced: 2024-03-15T01:23:31.870Z (8 months ago)
- Language: Python
- Size: 66.4 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - mkrd/Flask-Authorization - Simple user authorization to use alongside with Flask-Login (Python)
README
# Flask-Authorization
[![Downloads](https://pepy.tech/badge/flask-authorization)](https://pepy.tech/project/flask-authorization)
[![Downloads](https://pepy.tech/badge/flask-authorization/month)](https://pepy.tech/project/flask-authorization)
[![Downloads](https://pepy.tech/badge/flask-authorization/week)](https://pepy.tech/project/flask-authorization)Simple user authorization to use alongside with Flask-Login.
## Installation
```
pip3 install Flask-Authorization
```## Usage
```python
from flask_Authorization import Authorize
authorize = Authorize()# Initialize Extension
authorize.init_app(app)
```For Flask-Authorization to work properly, your user models needs to implement a function called `get_permissions()` that returns a list of permissions. You can define any permissions you like, but `"ROOT", "ADMIN", "USER"` are recommended.
Flask-Authorization will check if the current user has the required permissions on routes decorated with the `@flask_authorization.permission_required(permission)` decorator.