Last active
April 25, 2019 03:27
-
-
Save uds5501/0a6bd232b62351efeaf61d88dfdea352 to your computer and use it in GitHub Desktop.
api.haspermit decorator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask_rest_jsonapi import Api | |
from your_project.permission import permission_manager | |
app = Flask(__name__) | |
api = Api() | |
api.init_app(app) | |
api.permission_manager(permission_manager) | |
from flask_rest_jsonapi import ResourceList | |
from your_project.extensions import api | |
class PersonList(ResourceList): | |
disable_permission = True | |
@api.has_permission('custom_arg', custom_kwargs='custom_kwargs') | |
def get(*args, **kwargs): | |
return 'Hello world !' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment