Skip to content

Make current user available in calback_context#168

Open
robert-norberg wants to merge 4 commits intoplotly:mainfrom
robert-norberg:patch-1
Open

Make current user available in calback_context#168
robert-norberg wants to merge 4 commits intoplotly:mainfrom
robert-norberg:patch-1

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