fix(packages): Fixing users packages (#18973)

* Fixing users packages

* Linting me() fn

* Fixing tests / moving packages

* Fixing imports
This commit is contained in:
Craig Rueda
2022-03-01 09:47:13 -08:00
committed by GitHub
parent 563cce1e29
commit 5fc7adb55b
6 changed files with 37 additions and 3 deletions

View File

@@ -50,7 +50,6 @@ from superset.extensions import (
)
from superset.security import SupersetSecurityManager
from superset.typing import FlaskResponse
from superset.users.api import CurrentUserRestApi
from superset.utils.core import pessimistic_connection_handling
from superset.utils.log import DBEventLogger, get_event_logger_from_cfg_value
@@ -195,6 +194,7 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
TabStateView,
)
from superset.views.tags import TagView
from superset.views.users.api import CurrentUserRestApi
#
# Setup API views

View File

@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

View File

@@ -31,7 +31,7 @@ class CurrentUserRestApi(BaseApi):
@expose("/", methods=["GET"])
@safe
def me(self) -> Response:
def get_me(self) -> Response:
"""Get the user object corresponding to the agent making the request
---
get:

View File

@@ -905,7 +905,7 @@ class TestRolePermission(SupersetTestCase):
["LocaleView", "index"],
["AuthDBView", "login"],
["AuthDBView", "logout"],
["CurrentUserRestApi", "me"],
["CurrentUserRestApi", "get_me"],
["Dashboard", "embedded"],
["R", "index"],
["Superset", "log"],

View File

@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.