|
@@ -7,6 +7,7 @@ import org.aspectj.lang.annotation.Aspect;
|
|
|
import org.aspectj.lang.annotation.Before;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import com.ruoyi.common.annotation.DataScope;
|
|
|
+import com.ruoyi.common.constant.UserConstants;
|
|
|
import com.ruoyi.common.core.domain.BaseEntity;
|
|
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
@@ -73,8 +74,7 @@ public class DataScopeAspect
|
|
|
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
|
|
{
|
|
|
String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), PermissionContextHolder.getContext());
|
|
|
- dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
|
|
- controllerDataScope.userAlias(), permission);
|
|
|
+ dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), controllerDataScope.userAlias(), permission);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -94,7 +94,7 @@ public class DataScopeAspect
|
|
|
List<String> conditions = new ArrayList<String>();
|
|
|
List<String> scopeCustomIds = new ArrayList<String>();
|
|
|
user.getRoles().forEach(role -> {
|
|
|
- if (DATA_SCOPE_CUSTOM.equals(role.getDataScope()) && StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission)))
|
|
|
+ if (DATA_SCOPE_CUSTOM.equals(role.getDataScope()) && StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission)))
|
|
|
{
|
|
|
scopeCustomIds.add(Convert.toStr(role.getRoleId()));
|
|
|
}
|
|
@@ -103,7 +103,7 @@ public class DataScopeAspect
|
|
|
for (SysRole role : user.getRoles())
|
|
|
{
|
|
|
String dataScope = role.getDataScope();
|
|
|
- if (conditions.contains(dataScope))
|
|
|
+ if (conditions.contains(dataScope) || StringUtils.equals(role.getStatus(), UserConstants.ROLE_DISABLE))
|
|
|
{
|
|
|
continue;
|
|
|
}
|