Skip to content

Commit

Permalink
bugfix: 无权限提示信息带上用户名 TencentBlueKing#784
Browse files Browse the repository at this point in the history
  • Loading branch information
“liuliaozhong” committed Jan 4, 2023
1 parent a2b71b2 commit aa23f51
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 14 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=User ({0}) permission not allowed, please confirm and apply in IAM and try again
9900403=User ({0}) permission not allowed, please confirm and apply in IAM and try again
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=User ({0}) permission not allowed, please confirm and apply in IAM and try again
9900403=User ({0}) permission not allowed, please confirm and apply in IAM and try again
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 @@ -332,9 +332,9 @@ public class ErrorCode {

// ==================================== 系统级错误 ================================================//
// ======== 系统错误-权限错误 ==================//
// 用户权限不足
// 用户({0})权限不足,请前往权限中心确认并申请补充后重试
public static final int PERMISSION_DENIED = 1238001;
// 蓝鲸统一权限错误码
// 蓝鲸统一权限错误码,用户({0})权限不足,请前往权限中心确认并申请补充后重试
public static final int BK_PERMISSION_DENIED = 9900403;

// ========= 系统错误-请求 ====================//
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

0 comments on commit aa23f51

Please sign in to comment.