Skip to content
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

fix(api): /v1/me and /v1/me/roles access with JWT #31274

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions superset/views/users/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from flask import g, redirect, Response
from flask_appbuilder.api import expose, safe
from flask_jwt_extended.exceptions import NoAuthorizationError
from flask_jwt_extended.view_decorators import jwt_required
from sqlalchemy.orm.exc import NoResultFound

from superset import app, is_feature_enabled
Expand All @@ -38,6 +39,7 @@ class CurrentUserRestApi(BaseSupersetApi):

@expose("/", methods=("GET",))
@safe
@jwt_required(optional=True)
def get_me(self) -> Response:
"""Get the user object corresponding to the agent making the request.
---
Expand Down Expand Up @@ -69,6 +71,7 @@ def get_me(self) -> Response:

@expose("/roles/", methods=("GET",))
@safe
@jwt_required(optional=True)
def get_my_roles(self) -> Response:
"""Get the user roles corresponding to the agent making the request.
---
Expand Down