mirror of
https://github.com/docmost/docmost.git
synced 2026-05-17 23:14:07 +08:00
lint
This commit is contained in:
@@ -407,7 +407,6 @@
|
|||||||
"Share deleted successfully": "Share deleted successfully",
|
"Share deleted successfully": "Share deleted successfully",
|
||||||
"Share not found": "Share not found",
|
"Share not found": "Share not found",
|
||||||
"Failed to share page": "Failed to share page",
|
"Failed to share page": "Failed to share page",
|
||||||
"Public Sharing": "Public Sharing",
|
|
||||||
"Disable public sharing": "Disable public sharing",
|
"Disable public sharing": "Disable public sharing",
|
||||||
"Prevent members from sharing pages publicly.": "Prevent members from sharing pages publicly.",
|
"Prevent members from sharing pages publicly.": "Prevent members from sharing pages publicly.",
|
||||||
"Toggle public sharing": "Toggle public sharing",
|
"Toggle public sharing": "Toggle public sharing",
|
||||||
|
|||||||
@@ -202,7 +202,10 @@ export class ShareController {
|
|||||||
@Body() dto: ShareIdDto,
|
@Body() dto: ShareIdDto,
|
||||||
@AuthWorkspace() workspace: Workspace,
|
@AuthWorkspace() workspace: Workspace,
|
||||||
) {
|
) {
|
||||||
const treeData = await this.shareService.getShareTree(dto.shareId, workspace.id);
|
const treeData = await this.shareService.getShareTree(
|
||||||
|
dto.shareId,
|
||||||
|
workspace.id,
|
||||||
|
);
|
||||||
|
|
||||||
const sharingAllowed = await this.shareService.isSharingAllowed(
|
const sharingAllowed = await this.shareService.isSharingAllowed(
|
||||||
workspace.id,
|
workspace.id,
|
||||||
|
|||||||
@@ -264,7 +264,10 @@ export class ShareService {
|
|||||||
return ancestor;
|
return ancestor;
|
||||||
}
|
}
|
||||||
|
|
||||||
async isSharingAllowed(workspaceId: string, spaceId: string): Promise<boolean> {
|
async isSharingAllowed(
|
||||||
|
workspaceId: string,
|
||||||
|
spaceId: string,
|
||||||
|
): Promise<boolean> {
|
||||||
const result = await this.db
|
const result = await this.db
|
||||||
.selectFrom('workspaces')
|
.selectFrom('workspaces')
|
||||||
.innerJoin('spaces', 'spaces.workspaceId', 'workspaces.id')
|
.innerJoin('spaces', 'spaces.workspaceId', 'workspaces.id')
|
||||||
@@ -278,8 +281,10 @@ export class ShareService {
|
|||||||
|
|
||||||
if (!result) return false;
|
if (!result) return false;
|
||||||
|
|
||||||
const workspaceDisabled = (result.workspaceSettings as any)?.sharing?.disabled === true;
|
const workspaceDisabled =
|
||||||
const spaceDisabled = (result.spaceSettings as any)?.sharing?.disabled === true;
|
(result.workspaceSettings as any)?.sharing?.disabled === true;
|
||||||
|
const spaceDisabled =
|
||||||
|
(result.spaceSettings as any)?.sharing?.disabled === true;
|
||||||
|
|
||||||
return !workspaceDisabled && !spaceDisabled;
|
return !workspaceDisabled && !spaceDisabled;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user