fix(core): shared mode permission check (#13087)
close CLOUD-191 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved permission handling for shared mode workspaces to prevent unnecessary permission checks. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -168,6 +168,9 @@ export class GuardService extends Service {
|
|||||||
if (this.workspaceService.workspace.flavour === 'local') {
|
if (this.workspaceService.workspace.flavour === 'local') {
|
||||||
return {} as Record<WorkspacePermissionActions, boolean>;
|
return {} as Record<WorkspacePermissionActions, boolean>;
|
||||||
}
|
}
|
||||||
|
if (this.workspaceService.workspace.openOptions.isSharedMode) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
const permissions = await this.guardStore.getWorkspacePermissions();
|
const permissions = await this.guardStore.getWorkspacePermissions();
|
||||||
this.workspacePermissions$.next(permissions);
|
this.workspacePermissions$.next(permissions);
|
||||||
return permissions;
|
return permissions;
|
||||||
@@ -177,6 +180,9 @@ export class GuardService extends Service {
|
|||||||
if (this.workspaceService.workspace.flavour === 'local') {
|
if (this.workspaceService.workspace.flavour === 'local') {
|
||||||
return {} as Record<DocPermissionActions, boolean>;
|
return {} as Record<DocPermissionActions, boolean>;
|
||||||
}
|
}
|
||||||
|
if (this.workspaceService.workspace.openOptions.isSharedMode) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
const permissions = await this.guardStore.getDocPermissions(docId);
|
const permissions = await this.guardStore.getDocPermissions(docId);
|
||||||
this.docPermissions$.next({
|
this.docPermissions$.next({
|
||||||
...this.docPermissions$.value,
|
...this.docPermissions$.value,
|
||||||
|
|||||||
Reference in New Issue
Block a user