diff --git a/backend/src/main/java/io/metersphere/controller/RoleController.java b/backend/src/main/java/io/metersphere/controller/RoleController.java index 2faf7a3947..b1a40877f1 100644 --- a/backend/src/main/java/io/metersphere/controller/RoleController.java +++ b/backend/src/main/java/io/metersphere/controller/RoleController.java @@ -1,7 +1,9 @@ package io.metersphere.controller; import io.metersphere.base.domain.Role; +import io.metersphere.commons.constants.RoleConstants; import io.metersphere.service.RoleService; +import org.apache.shiro.authz.annotation.RequiresRoles; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; @@ -23,6 +25,7 @@ public class RoleController { } @GetMapping("/all") + @RequiresRoles(RoleConstants.ADMIN) public List getAllRole() { return roleService.getAllRole(); }