Skip to content

Commit

Permalink
fix bug: get role error when the projectUrl is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamlandliu committed Aug 24, 2022
1 parent f7894bc commit 6d9b5ce
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import ai.starwhale.mlops.domain.user.bo.Role;
import ai.starwhale.mlops.domain.user.bo.User;
import ai.starwhale.mlops.exception.api.StarWhaleApiException;
import cn.hutool.core.util.StrUtil;
import io.jsonwebtoken.Claims;
import java.io.IOException;
import java.util.List;
Expand Down Expand Up @@ -92,13 +93,13 @@ protected void doFilterInternal(HttpServletRequest httpServletRequest,
role -> role.getAuthority().equals("OWNER")).collect(Collectors.toSet());
// Get project roles
String projectUrl = httpServletRequest.getParameter("project");
if(projectUrl == null) {
if(StrUtil.isEmpty(projectUrl)) {
projectUrl = httpServletRequest.getParameter("projectUrl");
}
if(projectUrl == null) {
if(StrUtil.isEmpty(projectUrl)) {
projectUrl = HttpUtil.getResourceUrlFromPath(httpServletRequest.getRequestURI(), Resources.PROJECT);
}
if(projectUrl == null) {
if(StrUtil.isEmpty(projectUrl)) {
projectUrl = "0";
}
try {
Expand Down

0 comments on commit 6d9b5ce

Please sign in to comment.