|
@@ -7,6 +7,7 @@ import org.aspectj.lang.annotation.Aspect; |
|
@@ -7,6 +7,7 @@ import org.aspectj.lang.annotation.Aspect; |
|
7
|
import org.aspectj.lang.annotation.Before;
|
7
|
import org.aspectj.lang.annotation.Before;
|
|
8
|
import org.springframework.stereotype.Component;
|
8
|
import org.springframework.stereotype.Component;
|
|
9
|
import com.ruoyi.common.annotation.DataScope;
|
9
|
import com.ruoyi.common.annotation.DataScope;
|
|
|
|
10
|
+import com.ruoyi.common.constant.UserConstants;
|
|
10
|
import com.ruoyi.common.core.domain.BaseEntity;
|
11
|
import com.ruoyi.common.core.domain.BaseEntity;
|
|
11
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
12
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
12
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
13
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
@@ -73,8 +74,7 @@ public class DataScopeAspect |
|
@@ -73,8 +74,7 @@ public class DataScopeAspect |
|
73
|
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
74
|
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin())
|
|
74
|
{
|
75
|
{
|
|
75
|
String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), PermissionContextHolder.getContext());
|
76
|
String permission = StringUtils.defaultIfEmpty(controllerDataScope.permission(), PermissionContextHolder.getContext());
|
|
76
|
- dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(),
|
|
|
|
77
|
- controllerDataScope.userAlias(), permission);
|
77
|
+ dataScopeFilter(joinPoint, currentUser, controllerDataScope.deptAlias(), controllerDataScope.userAlias(), permission);
|
|
78
|
}
|
78
|
}
|
|
79
|
}
|
79
|
}
|
|
80
|
}
|
80
|
}
|
|
@@ -94,7 +94,7 @@ public class DataScopeAspect |
|
@@ -94,7 +94,7 @@ public class DataScopeAspect |
|
94
|
List<String> conditions = new ArrayList<String>();
|
94
|
List<String> conditions = new ArrayList<String>();
|
|
95
|
List<String> scopeCustomIds = new ArrayList<String>();
|
95
|
List<String> scopeCustomIds = new ArrayList<String>();
|
|
96
|
user.getRoles().forEach(role -> {
|
96
|
user.getRoles().forEach(role -> {
|
|
97
|
- if (DATA_SCOPE_CUSTOM.equals(role.getDataScope()) && StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission)))
|
97
|
+ if (DATA_SCOPE_CUSTOM.equals(role.getDataScope()) && StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission)))
|
|
98
|
{
|
98
|
{
|
|
99
|
scopeCustomIds.add(Convert.toStr(role.getRoleId()));
|
99
|
scopeCustomIds.add(Convert.toStr(role.getRoleId()));
|
|
100
|
}
|
100
|
}
|
|
@@ -103,7 +103,7 @@ public class DataScopeAspect |
|
@@ -103,7 +103,7 @@ public class DataScopeAspect |
|
103
|
for (SysRole role : user.getRoles())
|
103
|
for (SysRole role : user.getRoles())
|
|
104
|
{
|
104
|
{
|
|
105
|
String dataScope = role.getDataScope();
|
105
|
String dataScope = role.getDataScope();
|
|
106
|
- if (conditions.contains(dataScope))
|
106
|
+ if (conditions.contains(dataScope) || StringUtils.equals(role.getStatus(), UserConstants.ROLE_DISABLE))
|
|
107
|
{
|
107
|
{
|
|
108
|
continue;
|
108
|
continue;
|
|
109
|
}
|
109
|
}
|