Skip to content

Commit

Permalink
无权限提示信息带上用户名 TencentBlueKing#784
Browse files Browse the repository at this point in the history
  • Loading branch information
“liuliaozhong” committed Dec 28, 2022
1 parent 6e81232 commit 3c67260
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
0=成功

##系统错误-权限
1238001=用户权限不足
9900403=用户权限不足
1238001=用户{0}权限不足
9900403=用户{0}权限不足
1238002=用户无业务操作权限

##系统错误-API通用
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
0=Success

## System error - permissions
1238001=Insufficient user permissions
9900403=Insufficient user permissions
1238001=Insufficient user {0} permissions
9900403=Insufficient user {0} permissions
1238002=Insufficient user permissions for application

## System error - API common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
0=Success

## System error - permissions
1238001=Insufficient user permissions
9900403=Insufficient user permissions
1238001=Insufficient user {0} permissions
9900403=Insufficient user {0} permissions
1238002=Insufficient user permissions for application

## System error - API common
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
0=成功

##系统错误-权限
1238001=用户权限不足
9900403=用户权限不足
1238001=用户{0}权限不足
9900403=用户{0}权限不足
1238002=用户无业务操作权限

##系统错误-API通用
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
0=成功

##系统错误-权限
1238001=用户权限不足
9900403=用户权限不足
1238001=用户{0}权限不足
9900403=用户{0}权限不足
1238002=用户无业务操作权限

##系统错误-API通用
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public static <T> Response<T> buildSuccessResp(T data) {
}

public static <T> Response<T> buildAuthFailResp(AuthResultVO authResult) {
Response<T> resp = new Response<>(ErrorCode.PERMISSION_DENIED, null);
Response<T> resp = new Response<>(ErrorCode.PERMISSION_DENIED,
new String[]{JobContextUtil.getUsername()}, null);
resp.authResult = authResult;
return resp;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ public static <T> EsbResp<T> buildCommonFailResp(ServiceException e) {
}

public static <T> EsbResp<T> buildAuthFailResult(EsbApplyPermissionDTO permission) {
EsbResp<T> esbResp = buildCommonFailResp(ErrorCode.BK_PERMISSION_DENIED, null, null);
EsbResp<T> esbResp = buildCommonFailResp(ErrorCode.BK_PERMISSION_DENIED,
new String[]{JobContextUtil.getUsername()}, null);
esbResp.setPermission(permission);
return esbResp;
}
Expand Down
6 changes: 3 additions & 3 deletions src/backend/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ MAVEN_REPO_URL=
MAVEN_REPO_DEPLOY_URL=
MAVEN_REPO_USERNAME=
MAVEN_REPO_PASSWORD=
DB_HOST=
DB_USERNAME=
DB_PASSWORD=
DB_HOST=127.0.0.1
DB_USERNAME=root
DB_PASSWORD=root

0 comments on commit 3c67260

Please sign in to comment.