#6 权限校验

Open
created 1 year ago by wqm · 2 comments
wqm commented 1 year ago
wqm commented 1 year ago
Owner
权限校验逻辑则由shiro自动完成: 1. 登录成功或者会话登录,shiro已经有当前用户的权限列表; 2. 访问权限保护的方法时,shiro通过RequiresPermissions注解得到所需操作权限列表; 3. 测试已分配的权限和操作所需权限是否一致,如果一致则可以调用方法,否则抛出无权限的异常。
wqm commented 1 year ago
Owner
@RequiresPermissions("admin:ad:list") @RequiresPermissionsDesc(menu={"推广管理" , "广告管理"}, button="查询") @GetMapping("/list") public Object list(String name, String content, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer limit, @Sort @RequestParam(defaultValue = "add_time") String sort, @Order @RequestParam(defaultValue = "desc") String order) { List<LitemallAd> adList = adService.querySelective(name, content, page, limit, sort, order); int total = adService.countSelective(name, content, page, limit, sort, order); Map<String, Object> data = new HashMap<>(); data.put("total", total); data.put("items", adList); return ResponseUtil.ok(data); }
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.