Skip to content

Commit

Permalink
Better documentation for the get_user_roles callback argument (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
targhs authored Jun 26, 2022
1 parent f2b70b2 commit 03ff944
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ API Documentation

.. method:: get_user_roles(roles_callback)

If defined, this callback function will be called by the framework to obtain the roles assigned to a given user. The callback function takes a single argument, the user for which roles are requested. The user object passed to this function will be the one returned by the ``verify_callback`` function. The function should return the role or list of roles that belong to the user. Example::
If defined, this callback function will be called by the framework to obtain the roles assigned to a given user. The callback function takes a single argument, the user for which roles are requested. The user object passed to this function will be the one returned by the "verify" callback. If the verify callback returned ``True`` instead of a user object, then the ``Authorization`` object provided by Flask will be passed to this function. The function should return the role or list of roles that belong to the user. Example::

@auth.get_user_roles
def get_user_roles(user):
Expand Down

0 comments on commit 03ff944

Please sign in to comment.