fix(permission): 权限请求默认使用缓存

This commit is contained in:
zhansihu 2024-01-05 14:50:25 +08:00
parent 6b26fdc923
commit 2dbe9590ed
2 changed files with 4 additions and 3 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

@ -695,7 +695,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()