Browse Source

fix: use view id when setting ui acl cache

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/6318/head
Pranav C 1 year ago
parent
commit
f24b8b50c9
  1. 2
      packages/nocodb/src/cache/RedisCacheMgr.ts
  2. 2
      packages/nocodb/src/cache/RedisMockCacheMgr.ts
  3. 2
      packages/nocodb/src/models/ModelRoleVisibility.ts

2
packages/nocodb/src/cache/RedisCacheMgr.ts vendored

@ -178,7 +178,7 @@ export default class RedisCacheMgr extends CacheMgr {
let getKey = `${this.prefix}:${scope}:${o.id}`;
// special case - MODEL_ROLE_VISIBILITY
if (scope === CacheScope.MODEL_ROLE_VISIBILITY) {
getKey = `${this.prefix}:${scope}:${o.id}:${o.role}`;
getKey = `${this.prefix}:${scope}:${o.fk_view_id}:${o.role}`;
}
// set Get Key
log(`RedisCacheMgr::setList: setting key ${getKey}`);

2
packages/nocodb/src/cache/RedisMockCacheMgr.ts vendored

@ -174,7 +174,7 @@ export default class RedisMockCacheMgr extends CacheMgr {
let getKey = `${this.prefix}:${scope}:${o.id}`;
// special case - MODEL_ROLE_VISIBILITY
if (scope === CacheScope.MODEL_ROLE_VISIBILITY) {
getKey = `${this.prefix}:${scope}:${o.id}:${o.role}`;
getKey = `${this.prefix}:${scope}:${o.fk_view_id}:${o.role}`;
}
// set Get Key
log(`RedisMockCacheMgr::setList: setting key ${getKey}`);

2
packages/nocodb/src/models/ModelRoleVisibility.ts

@ -158,8 +158,6 @@ export default class ModelRoleVisibility implements ModelRoleVisibilityType {
insertObj.id = result.id;
await NocoCache.set(key, insertObj);
await NocoCache.appendToList(
CacheScope.MODEL_ROLE_VISIBILITY,
[insertObj.project_id],

Loading…
Cancel
Save