|
@@ -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
|
}
|
|
@@ -135,7 +135,7 @@ public class DataScopeAspect
|
|
135
|
}
|
135
|
}
|
|
136
|
else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope))
|
136
|
else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope))
|
|
137
|
{
|
137
|
{
|
|
138
|
- sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )", deptAlias, user.getDeptId(), user.getDeptId()));
|
|
|
|
|
|
138
|
+ sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set({}, ancestors) > 0 )", deptAlias, user.getDeptId(), user.getDeptId()));
|
|
139
|
}
|
139
|
}
|
|
140
|
else if (DATA_SCOPE_SELF.equals(dataScope))
|
140
|
else if (DATA_SCOPE_SELF.equals(dataScope))
|
|
141
|
{
|
141
|
{
|