Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Make current user available in calback_context#168

Open
robert-norberg wants to merge 4 commits intoplotly:mainplotly/dash-auth:mainfrom
robert-norberg:patch-1robert-norberg/dash-auth:patch-1Copy head branch name to clipboard
Open

Make current user available in calback_context#168
robert-norberg wants to merge 4 commits intoplotly:mainplotly/dash-auth:mainfrom
robert-norberg:patch-1robert-norberg/dash-auth:patch-1Copy head branch name to clipboard

Conversation

@robert-norberg
Copy link

Adds a hook so that the currently logged in user object can be accessed in any callback by e.g.

@app.callback(Output(...), Input(...))
def some_callback_function(input1):
    ...
    current_user = dash.callback_context.custom_data.get("user")
    if "admin" in current_user.get("groups", []):
        ...
    else:
        ...

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.