This is a function that takes an array of users as an argument and checks if the role is an admin
Project description
Admin Protected Route
This is a function that takes an array of users as an argument and checks if the role is an admin. If that isn't the case, the function returns an unauthorized status code and message. Otherwise, the user is permitted to use the function.
How to use the decorator to protect routes
example:
from arrotechtools import admin_required
@jwt_required
@admin_required(users)
def signup():
...
The decorator takes a dictionary of users
as an argument.
Author
Harun Gachanja G.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for arrotechtools-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76a70180ac419aa6df94e4e7d783a69e00e63dec9d4565b65551aae08f061bae |
|
MD5 | 5c6e333da713e3248d19884642d7651b |
|
BLAKE2b-256 | 612c74ebdadb1f10e4d35607e3f4c88cbcc7e641cc2b83c398718eb50bbd2bda |