fix(系统设置): 缺陷添加评论权限

--bug=1036292 --user=宋昌昌 【系统设置】用户组-项目用户组-缺陷管理-无评论权限选项 https://www.tapd.cn/55049933/s/1470628
This commit is contained in:
song-cc-rock 2024-03-06 18:21:31 +08:00 committed by 刘瑞斌
parent f10740acc7
commit 669f992b6c
4 changed files with 10 additions and 3 deletions

View File

@ -108,6 +108,7 @@ INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_BUG:READ+UPDATE'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_BUG:READ+UPDATE');
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_BUG:READ+DELETE'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_BUG:READ+DELETE');
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_BUG:READ+EXPORT'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_BUG:READ+EXPORT');
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_BUG:READ+COMMENT');
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_BASE_INFO:READ+UPDATE'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_BASE_INFO:READ+UPDATE');
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_API_DEBUG:READ'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_API_DEBUG:READ');
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_API_DEBUG:READ+ADD'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_admin', 'PROJECT_API_DEBUG:READ+ADD');
@ -197,6 +198,7 @@ INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_BUG:READ+UPDATE'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_BUG:READ+UPDATE');
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_BUG:READ+DELETE'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_BUG:READ+DELETE');
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_BUG:READ+EXPORT'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_BUG:READ+EXPORT');
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_BUG:READ+COMMENT');
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_CUSTOM_FUNCTION:READ'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_CUSTOM_FUNCTION:READ');
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_CUSTOM_FUNCTION:READ+ADD'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_CUSTOM_FUNCTION:READ+ADD');
INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_CUSTOM_FUNCTION:READ+UPDATE'); INSERT INTO user_role_permission (id, role_id, permission_id) VALUES (UUID_SHORT(), 'project_member', 'PROJECT_CUSTOM_FUNCTION:READ+UPDATE');

View File

@ -253,6 +253,7 @@ public class PermissionConstants {
public static final String PROJECT_BUG_UPDATE = "PROJECT_BUG:READ+UPDATE"; public static final String PROJECT_BUG_UPDATE = "PROJECT_BUG:READ+UPDATE";
public static final String PROJECT_BUG_DELETE = "PROJECT_BUG:READ+DELETE"; public static final String PROJECT_BUG_DELETE = "PROJECT_BUG:READ+DELETE";
public static final String PROJECT_BUG_EXPORT = "PROJECT_BUG:READ+EXPORT"; public static final String PROJECT_BUG_EXPORT = "PROJECT_BUG:READ+EXPORT";
public static final String PROJECT_BUG_COMMENT = "PROJECT_BUG:READ+COMMENT";
/*------ end: BUG ------*/ /*------ end: BUG ------*/
/*------ start: API_MANAGEMENT ------*/ /*------ start: API_MANAGEMENT ------*/
public static final String PROJECT_API_DEFINITION_READ = "PROJECT_API_DEFINITION:READ"; public static final String PROJECT_API_DEFINITION_READ = "PROJECT_API_DEFINITION:READ";

View File

@ -33,7 +33,7 @@ public class BugCommentController {
@PostMapping("/add") @PostMapping("/add")
@Operation(summary = "缺陷管理-评论-新增/回复评论") @Operation(summary = "缺陷管理-评论-新增/回复评论")
@RequiresPermissions(PermissionConstants.PROJECT_BUG_READ) @RequiresPermissions(PermissionConstants.PROJECT_BUG_COMMENT)
@CheckOwner(resourceId = "#request.getBugId()", resourceType = "bug") @CheckOwner(resourceId = "#request.getBugId()", resourceType = "bug")
public BugComment add(@RequestBody BugCommentEditRequest request) { public BugComment add(@RequestBody BugCommentEditRequest request) {
return bugCommentService.addComment(request, SessionUtils.getUserId()); return bugCommentService.addComment(request, SessionUtils.getUserId());
@ -41,7 +41,7 @@ public class BugCommentController {
@PostMapping("/update") @PostMapping("/update")
@Operation(summary = "缺陷管理-评论-编辑评论") @Operation(summary = "缺陷管理-评论-编辑评论")
@RequiresPermissions(PermissionConstants.PROJECT_BUG_READ) @RequiresPermissions(PermissionConstants.PROJECT_BUG_COMMENT)
@CheckOwner(resourceId = "#request.getBugId()", resourceType = "bug") @CheckOwner(resourceId = "#request.getBugId()", resourceType = "bug")
public BugComment update(@RequestBody BugCommentEditRequest request) { public BugComment update(@RequestBody BugCommentEditRequest request) {
return bugCommentService.updateComment(request, SessionUtils.getUserId()); return bugCommentService.updateComment(request, SessionUtils.getUserId());
@ -49,7 +49,7 @@ public class BugCommentController {
@GetMapping("/delete/{commentId}") @GetMapping("/delete/{commentId}")
@Operation(summary = "缺陷管理-评论-删除评论") @Operation(summary = "缺陷管理-评论-删除评论")
@RequiresPermissions(PermissionConstants.PROJECT_BUG_READ) @RequiresPermissions(PermissionConstants.PROJECT_BUG_COMMENT)
public void delete(@PathVariable String commentId) { public void delete(@PathVariable String commentId) {
bugCommentService.deleteComment(commentId, SessionUtils.getUserId()); bugCommentService.deleteComment(commentId, SessionUtils.getUserId());
} }

View File

@ -22,6 +22,10 @@
}, },
{ {
"id": "PROJECT_BUG:READ+EXPORT" "id": "PROJECT_BUG:READ+EXPORT"
},
{
"id": "PROJECT_BUG:READ+COMMENT",
"name": "permission.functional_case.comment"
} }
] ]
} }