Skip to content

Commit

Permalink
[Improve] shiro permission improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
benjobs committed Apr 10, 2024
1 parent 9a02951 commit ab93ed1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ public class MemberController {

@Operation(summary = "List members")
@PostMapping("list")
@RequiresPermissions("member:view")
public RestResponse memberList(RestRequest restRequest, Member member) {
IPage<Member> userList = memberService.page(member, restRequest);
return RestResponse.success(userList);
}

@Operation(summary = "List candidate users")
@PostMapping("candidateUsers")
@RequiresPermissions("member:add")
public RestResponse candidateUsers(Long teamId) {
List<User> userList = memberService.findCandidateUsers(teamId);
return RestResponse.success(userList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import org.apache.streampark.console.system.service.TeamService;
import org.apache.streampark.console.system.service.UserService;

import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;

import com.baomidou.mybatisplus.core.metadata.IPage;
Expand Down Expand Up @@ -66,9 +65,7 @@ public class UserController {

@Operation(summary = "List users")
@PostMapping("list")
@RequiresPermissions(
value = {"user:view", "app:view"},
logical = Logical.OR)
@RequiresPermissions("user:view")
public RestResponse userList(RestRequest restRequest, User user) {
IPage<User> userList = userService.page(user, restRequest);
return RestResponse.success(userList);
Expand Down Expand Up @@ -101,6 +98,7 @@ public RestResponse deleteUser(Long userId) throws Exception {

@Operation(summary = "List without token users")
@PostMapping("getNoTokenUser")
@RequiresPermissions("token:add")
public RestResponse getNoTokenUser() {
List<User> userList = this.userService.getNoTokenUser();
return RestResponse.success(userList);
Expand Down

0 comments on commit ab93ed1

Please sign in to comment.