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:
EYHN
2025-07-08 16:23:19 +08:00
committed by GitHub
parent afb3907efa
commit f6a45ae20b

View File

@@ -168,6 +168,9 @@ export class GuardService extends Service {
if (this.workspaceService.workspace.flavour === 'local') {
return {} as Record<WorkspacePermissionActions, boolean>;
}
if (this.workspaceService.workspace.openOptions.isSharedMode) {
return {};
}
const permissions = await this.guardStore.getWorkspacePermissions();
this.workspacePermissions$.next(permissions);
return permissions;
@@ -177,6 +180,9 @@ export class GuardService extends Service {
if (this.workspaceService.workspace.flavour === 'local') {
return {} as Record<DocPermissionActions, boolean>;
}
if (this.workspaceService.workspace.openOptions.isSharedMode) {
return {};
}
const permissions = await this.guardStore.getDocPermissions(docId);
this.docPermissions$.next({
...this.docPermissions$.value,