Skip to content

Make current user available in calback_context #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

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