|
@@ -75,7 +75,7 @@ export interface PageModel extends Model<PageDocument> {
|
|
|
findTargetAndAncestorsByPathOrId(pathOrId: string): Promise<TargetAndAncestorsResult>
|
|
findTargetAndAncestorsByPathOrId(pathOrId: string): Promise<TargetAndAncestorsResult>
|
|
|
findRecentUpdatedPages(path: string, user, option, includeEmpty?: boolean): Promise<PaginatedPages>
|
|
findRecentUpdatedPages(path: string, user, option, includeEmpty?: boolean): Promise<PaginatedPages>
|
|
|
generateGrantCondition(
|
|
generateGrantCondition(
|
|
|
- user, userGroups, includeAnyoneWithTheLink?: boolean, showPagesRestrictedByOwner?: boolean, showPagesRestrictedByGroup?: boolean,
|
|
|
|
|
|
|
+ user, userGroups: string[] | null, includeAnyoneWithTheLink?: boolean, showPagesRestrictedByOwner?: boolean, showPagesRestrictedByGroup?: boolean,
|
|
|
): { $or: any[] }
|
|
): { $or: any[] }
|
|
|
findNonEmptyClosestAncestor(path: string): Promise<PageDocument | undefined>
|
|
findNonEmptyClosestAncestor(path: string): Promise<PageDocument | undefined>
|
|
|
findNotEmptyParentByPathRecursively(path: string): Promise<PageDocument | undefined>
|
|
findNotEmptyParentByPathRecursively(path: string): Promise<PageDocument | undefined>
|
|
@@ -417,7 +417,7 @@ export class PageQueryBuilder {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
addConditionToFilteringByViewer(
|
|
addConditionToFilteringByViewer(
|
|
|
- user, userGroups, includeAnyoneWithTheLink = false, showPagesRestrictedByOwner = false, showPagesRestrictedByGroup = false,
|
|
|
|
|
|
|
+ user, userGroups: string[] | null, includeAnyoneWithTheLink = false, showPagesRestrictedByOwner = false, showPagesRestrictedByGroup = false,
|
|
|
): PageQueryBuilder {
|
|
): PageQueryBuilder {
|
|
|
const condition = generateGrantCondition(user, userGroups, includeAnyoneWithTheLink, showPagesRestrictedByOwner, showPagesRestrictedByGroup);
|
|
const condition = generateGrantCondition(user, userGroups, includeAnyoneWithTheLink, showPagesRestrictedByOwner, showPagesRestrictedByGroup);
|
|
|
|
|
|
|
@@ -962,7 +962,7 @@ schema.statics.findParent = async function(pageId): Promise<PageDocument | null>
|
|
|
schema.statics.PageQueryBuilder = PageQueryBuilder as any; // mongoose does not support constructor type as statics attrs type
|
|
schema.statics.PageQueryBuilder = PageQueryBuilder as any; // mongoose does not support constructor type as statics attrs type
|
|
|
|
|
|
|
|
export function generateGrantCondition(
|
|
export function generateGrantCondition(
|
|
|
- user, userGroups, includeAnyoneWithTheLink = false, showPagesRestrictedByOwner = false, showPagesRestrictedByGroup = false,
|
|
|
|
|
|
|
+ user, userGroups: string[] | null, includeAnyoneWithTheLink = false, showPagesRestrictedByOwner = false, showPagesRestrictedByGroup = false,
|
|
|
): { $or: any[] } {
|
|
): { $or: any[] } {
|
|
|
const grantConditions: AnyObject[] = [
|
|
const grantConditions: AnyObject[] = [
|
|
|
{ grant: null },
|
|
{ grant: null },
|