Commit 2d18ed9678a108fd5f89dadaa31136ddaba31be0
1 parent
934c4d81
feat: add data component PreAuthorize
Showing
1 changed file
with
3 additions
and
0 deletions
... | ... | @@ -37,6 +37,7 @@ public class YtDataComponentController extends BaseController { |
37 | 37 | |
38 | 38 | @GetMapping("/{boardId}") |
39 | 39 | @ApiOperation(value = "查询看板下的所有组件信息") |
40 | + @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{'api:yt:data_component:list'})") | |
40 | 41 | public ResponseResult<MoreDataComponentInfoDTO> getDataComponentsByBoardId( |
41 | 42 | @PathVariable("boardId") String boardId) throws ThingsboardException { |
42 | 43 | DataBoardDTO dataBoardDTO = checkDataBoardInfo(boardId); |
... | ... | @@ -51,6 +52,7 @@ public class YtDataComponentController extends BaseController { |
51 | 52 | |
52 | 53 | @PostMapping("/{boardId}/add") |
53 | 54 | @ApiOperation(value = "新增组件") |
55 | + @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{'api:yt:data_component:add:post'})") | |
54 | 56 | public ResponseResult<DataComponentDTO> save( |
55 | 57 | @PathVariable("boardId") String boardId, |
56 | 58 | @RequestBody @Validated(AddGroup.class) DataComponentDTO dataComponent) |
... | ... | @@ -73,6 +75,7 @@ public class YtDataComponentController extends BaseController { |
73 | 75 | |
74 | 76 | @PostMapping("/{boardId}/update") |
75 | 77 | @ApiOperation(value = "编辑组件") |
78 | + @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN','CUSTOMER_USER'},{'api:yt:data_component:update:update'})") | |
76 | 79 | public ResponseResult<DataComponentDTO> update( |
77 | 80 | @PathVariable("boardId") String boardId, |
78 | 81 | @RequestBody @Validated(UpdateGroup.class) DataComponentDTO dataComponent) | ... | ... |