-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update perm for access webconsole api (#1565)
* feat: update perm for access webconsole api * feat: update perm for access webconsole api
- Loading branch information
bellke
authored
Sep 28, 2021
1 parent
4ae53fe
commit a3103ff
Showing
3 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community | ||
Edition) available. | ||
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. | ||
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://opensource.org/licenses/MIT | ||
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. | ||
""" | ||
from backend.utils.func_controller import get_func_controller | ||
|
||
|
||
def check_app_access_webconsole_enable(app_code: str, project_id_or_code: str) -> bool: | ||
"""APP是否可以访问webconsole接口 | ||
NOTE:存储内容包含app_code和project信息(包含project_code和project_id),格式app_code:project_id_or_code | ||
""" | ||
func_code = "APP_ACCESS_WEBCONSOLE" | ||
enabled, wlist = get_func_controller(func_code) | ||
if enabled or f"{app_code}:{project_id_or_code}" in wlist: | ||
return True | ||
return False |