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

bugfix:无权限提示信息带上用户名 #784 #1652

Merged
merged 1 commit into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
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
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 @@ -320,9 +320,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