Merge remote-tracking branch 'origin/feature/REQ-2046' into feature/REQ-2046

This commit is contained in:
TanJ 2024-01-05 16:17:08 +08:00
commit 4b1d49f1a9
3 changed files with 5 additions and 4 deletions

View File

@ -62,8 +62,9 @@ public class IdentityAuthReq {
/** 指定角色ID - 预览用,不需要用户已配置角色 **/
private Set<Long> specifyRoleIds;
/** 是否使用缓存 **/
private Boolean useCache;
/** 是否使用缓存 - 默认true **/
@Builder.Default
private boolean useCache = true;
@Data

View File

@ -177,7 +177,7 @@ public class SaasFeature extends BaseEntity<SaasFeature> implements Serializable
return Collections.emptySet();
}
return StrUtil.split(this.path, "/").stream()
.filter(id -> StrUtil.equals(id, "0"))
.filter(x -> StrUtil.isNotBlank(x) && !StrUtil.equals(x, "0"))
.map(Long::valueOf)
.collect(Collectors.toSet());
}

View File

@ -696,7 +696,7 @@ public class TyrSaasAuthServiceImpl implements TyrSaasAuthService {
public IdentityAuthRes findIdentityAuthMix(IdentityAuthReq req) {
List<IdentityAuthRes.WorkspacePermission> permissions = null;
//不走缓存的情况关闭缓存开关 - 缓存临时禁用 - 请求指明不走缓存 - 角色预览操作
boolean notUseCache = BooleanUtil.isFalse(req.getUseCache())
boolean notUseCache = !req.isUseCache()
|| CollectionUtil.isNotEmpty(req.getSpecifyRoleIds())
|| permissionCacheService.cacheDisable(
PermissionCacheKey.builder()