Skip to content

Add auth_required(roles) and doc(tags) arguments for list value#26

Merged
greyli merged 3 commits intomasterfrom
roles-and-tags
Apr 19, 2021
Merged

Add auth_required(roles) and doc(tags) arguments for list value#26
greyli merged 3 commits intomasterfrom
roles-and-tags

Conversation

@greyli
Copy link
Copy Markdown
Member

@greyli greyli commented Apr 19, 2021

Actually, without this PR, the role and tag argument can also handle list value. This change basically used to make the API more consistent since we have example and examples.

Example usage for roles:

@app.get('/baz')
@auth_required(auth, roles=['admin', 'moderator'])
def baz():
    return auth.current_user

Example usage for tags:

@app.get('/bar')
@doc(tags=['foo', 'bar'])
def bar():
    pass

Checklist:

  • Update changelog
  • Add tests

@greyli greyli merged commit 696ed97 into master Apr 19, 2021
@greyli greyli deleted the roles-and-tags branch April 19, 2021 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant