|
@@ -7,8 +7,6 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 客户数据权限业务
|
|
* 客户数据权限业务
|
|
|
*/
|
|
*/
|
|
@@ -26,19 +24,9 @@ public class SysCustomerDataPermissionService {
|
|
|
throw new BusinessException(400, "无权操作");
|
|
throw new BusinessException(400, "无权操作");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- UserContextHolder.getUserContext().getRoles().stream()
|
|
|
|
|
- .filter(role -> !"Admin".equals(role))
|
|
|
|
|
- .filter(Objects::nonNull)
|
|
|
|
|
- .findAny()
|
|
|
|
|
- .ifPresent(role -> {
|
|
|
|
|
- throw new BusinessException(400, "无权操作");
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-// if (!UserContextHolder.getUserContext().getRoles().contains("Admin") ||
|
|
|
|
|
-// !UserContextHolder.getUserContext().getRoles().contains("Member")) {
|
|
|
|
|
-// throw new BusinessException(400, "无权操作");
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ if (!UserContextHolder.getUserContext().getRoles().contains("Admin")) {
|
|
|
|
|
+ throw new BusinessException(400, "无权操作");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void adminPermission() throws BusinessException{
|
|
public void adminPermission() throws BusinessException{
|