Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix-16578] Fix environment resource permission #16579

Merged
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,9 @@ public static class EnvironmentResourcePermissionCheck implements ResourceAcquis

private final EnvironmentMapper environmentMapper;

@Autowired
private ProcessService processService;
ruanwenjun marked this conversation as resolved.
Show resolved Hide resolved

public EnvironmentResourcePermissionCheck(EnvironmentMapper environmentMapper) {
this.environmentMapper = environmentMapper;
}
Expand All @@ -267,6 +270,10 @@ public List<AuthorizationType> authorizationTypes() {

@Override
public boolean permissionCheck(int userId, String url, Logger logger) {
User user = processService.getUserById(userId);
if (user.getUserType() != UserType.ADMIN_USER) {
return false;
}
SbloodyS marked this conversation as resolved.
Show resolved Hide resolved
return true;
}

Expand Down
Loading