mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
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') {
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user