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 (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-01T23:41:30.000Z (almost 2 years ago)
- Last Synced: 2024-09-25T09:21:02.996Z (5 months ago)
- Language: Python
- Size: 66.4 KB
- Stars: 6
- 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
[](https://pepy.tech/project/flask-authorization)
[](https://pepy.tech/project/flask-authorization)
[](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.