|
|
@ -6,6 +6,7 @@ import org.aspectj.lang.JoinPoint;
|
|
|
|
import org.aspectj.lang.annotation.Aspect;
|
|
|
|
import org.aspectj.lang.annotation.Aspect;
|
|
|
|
import org.aspectj.lang.annotation.Before;
|
|
|
|
import org.aspectj.lang.annotation.Before;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
import com.ruoyi.common.core.constant.UserConstants;
|
|
|
|
import com.ruoyi.common.core.context.SecurityContextHolder;
|
|
|
|
import com.ruoyi.common.core.context.SecurityContextHolder;
|
|
|
|
import com.ruoyi.common.core.text.Convert;
|
|
|
|
import com.ruoyi.common.core.text.Convert;
|
|
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
|
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
|
@ -73,8 +74,7 @@ public class DataScopeAspect
|
|
|
|
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
|
|
|
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), SecurityContextHolder.getPermission());
|
|
|
|
String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), SecurityContextHolder.getPermission());
|
|
|
|
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
|
|
|
dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), controllerDataScope.userAlias(), permission);
|
|
|
|
controllerDataScope.userAlias(), permission);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -103,7 +103,7 @@ public class DataScopeAspect
|
|
|
|
for (SysRole role : user.getRoles())
|
|
|
|
for (SysRole role : user.getRoles())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
String dataScope = role.getDataScope();
|
|
|
|
String dataScope = role.getDataScope();
|
|
|
|
if (conditions.contains(dataScope))
|
|
|
|
if (conditions.contains(dataScope) || StringUtils.equals(role.getStatus(), UserConstants.ROLE_DISABLE))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|