Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 570 Bytes

Authorization.md

File metadata and controls

31 lines (22 loc) · 570 Bytes

Authorization

By default flask-restly assumes that client is authorized

If authorization provider return False, then Forbidden exception is raised.

Usage

from flask_restly.decorator import auth

To implement Your custom authorization function:

@auth.provider
def authorize():
    return True

In some cases authorization should not be verified for particular endpoint(s):

@resource(name='some')
class SomeResource():
    @get('/')
    @auth.unauthorized
    def can_be_not_authorized(self):
        return