类 PermissionControllerV3

java.lang.Object
com.alibaba.nacos.plugin.auth.impl.controller.v3.PermissionControllerV3

@RestController @RequestMapping("/v3/auth/permission") public class PermissionControllerV3 extends Object
Controller for handling HTTP requests related to permission operations.
作者:
zhangyukun on:2024/8/16
  • 字段详细资料

  • 构造器详细资料

    • PermissionControllerV3

      @Autowired public PermissionControllerV3(NacosRoleService nacosRoleService)
      Constructs a new ConsolePermissionController with the provided PermissionProxy.
      参数:
      nacosRoleService - nacosRoleService instance
  • 方法详细资料

    • createPermission

      @PostMapping public com.alibaba.nacos.api.model.v2.Result<String> createPermission(@RequestParam String role, @RequestParam String resource, @RequestParam String action)
      Add a permission to a role.
      参数:
      role - the role
      resource - the related resource
      action - the related action
      返回:
      ok if succeed
    • deletePermission

      @DeleteMapping public com.alibaba.nacos.api.model.v2.Result<String> deletePermission(@RequestParam String role, @RequestParam String resource, @RequestParam String action)
      Delete a permission from a role.
      参数:
      role - the role
      resource - the related resource
      action - the related action
      返回:
      ok if succeed
    • getPermissionList

      @GetMapping("/list") public com.alibaba.nacos.api.model.v2.Result<com.alibaba.nacos.api.model.Page<PermissionInfo>> getPermissionList(@RequestParam int pageNo, @RequestParam int pageSize, @RequestParam(name="role",defaultValue="") String role, @RequestParam(name="search",defaultValue="accurate") String search)
      Query permissions of a role.
      参数:
      pageNo - page index
      pageSize - page size
      role - the role
      search - the type of search (accurate or blur)
      返回:
      permission of a role
    • isDuplicatePermission

      @GetMapping public com.alibaba.nacos.api.model.v2.Result<Boolean> isDuplicatePermission(@RequestParam String role, @RequestParam String resource, @RequestParam String action)
      Judge whether a permission is duplicate.
      参数:
      role - the role
      resource - the related resource
      action - the related action
      返回:
      true if duplicate, false otherwise