mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 01:19:19 +08:00
fix(auth): AccountController 添加公司拥有者权限限制
- 创建账户接口添加 @RequireRole(allowUser = false) - 更新账户接口添加 @RequireRole(allowUser = false) 现在这些接口只有公司拥有者(super admin 和 owner)可以调用
This commit is contained in:
+3
@@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import top.xyquan.ecomdmbbackend.common.annotation.RequireRole;
|
||||
import top.xyquan.ecomdmbbackend.common.response.ApiResponse;
|
||||
import top.xyquan.ecomdmbbackend.common.model.dto.PageQueryDTO;
|
||||
import top.xyquan.ecomdmbbackend.common.model.vo.PageResultVO;
|
||||
@@ -30,6 +31,7 @@ public class AccountController {
|
||||
|
||||
@Operation(summary = "创建账户(管理员)", description = "公司管理员创建本公司账户")
|
||||
@PostMapping("/create")
|
||||
@RequireRole(description = "创建账户", allowUser = false)
|
||||
public ApiResponse<AccountVO> createAccountForCompany(@Valid @RequestBody CreateAccountDTO createAccountDTO) {
|
||||
AccountVO accountVO = accountService.createAccountForCompany(createAccountDTO);
|
||||
return ApiResponse.success(accountVO);
|
||||
@@ -44,6 +46,7 @@ public class AccountController {
|
||||
|
||||
@Operation(summary = "更新账户信息", description = "公司管理员更新本公司账户信息")
|
||||
@PutMapping("/update/{accountId}")
|
||||
@RequireRole(description = "更新账户", allowUser = false)
|
||||
public ApiResponse<AccountVO> updateAccount(
|
||||
@Parameter(description = "账户ID", example = "1") @PathVariable Long accountId,
|
||||
@Valid @RequestBody UpdateAccountDTO updateAccountDTO) {
|
||||
|
||||
Reference in New Issue
Block a user