fix(auth): 修复SQL查询
This commit is contained in:
parent
e5e0c2463b
commit
113ad0eb43
@ -744,9 +744,10 @@ public class TyrSaasAuthServiceImpl implements TyrSaasAuthService {
|
|||||||
List<SaasRoleWithUser> superAdmins = roleService.listSuperAdminByWorkspace(Collections.singletonList(req.getWorkspaceId()));
|
List<SaasRoleWithUser> superAdmins = roleService.listSuperAdminByWorkspace(Collections.singletonList(req.getWorkspaceId()));
|
||||||
for (SaasRoleWithUser superAdmin : superAdmins) {
|
for (SaasRoleWithUser superAdmin : superAdmins) {
|
||||||
Set<String> distinctSet = distinctMap.getOrDefault(superAdmin.getOuId(), new HashSet<>());
|
Set<String> distinctSet = distinctMap.getOrDefault(superAdmin.getOuId(), new HashSet<>());
|
||||||
boolean exist = distinctSet.add(superAdmin.getIdentityId() + "-" + superAdmin.getIdentityType());
|
boolean suc = distinctSet.add(superAdmin.getIdentityId() + "-" + superAdmin.getIdentityType());
|
||||||
distinctMap.put(superAdmin.getOuId(), distinctSet);
|
distinctMap.put(superAdmin.getOuId(), distinctSet);
|
||||||
if (exist) {
|
if (!suc) {
|
||||||
|
log.info("duplicate identity:{}, identityType:{}", superAdmin.getIdentityId(), superAdmin.getIdentityType());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ListIdentityFromPermissionResp resp = result.getOrDefault(superAdmin.getOuId(), new ListIdentityFromPermissionResp());
|
ListIdentityFromPermissionResp resp = result.getOrDefault(superAdmin.getOuId(), new ListIdentityFromPermissionResp());
|
||||||
@ -779,9 +780,10 @@ public class TyrSaasAuthServiceImpl implements TyrSaasAuthService {
|
|||||||
|
|
||||||
for (SaasRoleUserRelation relation : relations) {
|
for (SaasRoleUserRelation relation : relations) {
|
||||||
Set<String> distinctSet = distinctMap.getOrDefault(relation.getOuId(), new HashSet<>());
|
Set<String> distinctSet = distinctMap.getOrDefault(relation.getOuId(), new HashSet<>());
|
||||||
boolean exist = distinctSet.add(relation.getIdentityId() + "-" + relation.getIdentityType());
|
boolean suc = distinctSet.add(relation.getIdentityId() + "-" + relation.getIdentityType());
|
||||||
distinctMap.put(relation.getOuId(), distinctSet);
|
distinctMap.put(relation.getOuId(), distinctSet);
|
||||||
if (exist) {
|
if (!suc) {
|
||||||
|
log.info("duplicate identity:{}, identityType:{}", relation.getIdentityId(), relation.getIdentityType());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,10 @@
|
|||||||
FROM saas_pgroup_permission_relation pg, saas_pgroup_role_relation rg, saas_role r
|
FROM saas_pgroup_permission_relation pg, saas_pgroup_role_relation rg, saas_role r
|
||||||
WHERE pg.is_delete = 0 AND rg.is_delete = 0 AND r.is_delete = 0
|
WHERE pg.is_delete = 0 AND rg.is_delete = 0 AND r.is_delete = 0
|
||||||
AND pg.group_id = rg.group_id AND rg.role_id = r.id
|
AND pg.group_id = rg.group_id AND rg.role_id = r.id
|
||||||
AND pg.feature_id IN (#{featureIds})
|
AND pg.feature_id IN
|
||||||
|
<foreach collection="featureIds" open="(" close=")" separator="," index="index" item="item">
|
||||||
|
#{item, jdbcType=NUMERIC}
|
||||||
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue
Block a user