|
@@ -1,6 +1,5 @@
|
|
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
import escapeStringRegexp from 'escape-string-regexp';
|
|
|
|
|
|
|
|
-import { type IUserStatus, USER_STATUS } from '../../interfaces';
|
|
|
|
|
import { isValidObjectId } from '../objectid-utils';
|
|
import { isValidObjectId } from '../objectid-utils';
|
|
|
import { addTrailingSlash } from '../path-utils';
|
|
import { addTrailingSlash } from '../path-utils';
|
|
|
|
|
|
|
@@ -40,24 +39,17 @@ export const isUsersHomepage = (path: string): boolean => {
|
|
|
/**
|
|
/**
|
|
|
* Whether path is the protected pages for systems
|
|
* Whether path is the protected pages for systems
|
|
|
* @param path
|
|
* @param path
|
|
|
- * @param creatorStatus
|
|
|
|
|
- * @param isUsersHomepageDeletionEnabled
|
|
|
|
|
*/
|
|
*/
|
|
|
-export const isUsersProtectedPages = (path: string, creatorStatus?: IUserStatus, isUsersHomepageDeletionEnabled?: boolean): boolean => {
|
|
|
|
|
- if (isUsersHomepageDeletionEnabled && creatorStatus === USER_STATUS.DELETED) {
|
|
|
|
|
- return isUsersTopPage(path);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+export const isUsersProtectedPages = (path: string): boolean => {
|
|
|
return isUsersTopPage(path) || isUsersHomepage(path);
|
|
return isUsersTopPage(path) || isUsersHomepage(path);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Whether path is movable
|
|
* Whether path is movable
|
|
|
* @param path
|
|
* @param path
|
|
|
- * @param creatorStatus
|
|
|
|
|
- * @param isUsersHomepageDeletionEnabled
|
|
|
|
|
*/
|
|
*/
|
|
|
-export const isMovablePage = (path: string, creatorStatus?: IUserStatus, isUsersHomepageDeletionEnabled?: boolean): boolean => {
|
|
|
|
|
- return !isTopPage(path) && !isUsersProtectedPages(path, creatorStatus, isUsersHomepageDeletionEnabled);
|
|
|
|
|
|
|
+export const isMovablePage = (path: string): boolean => {
|
|
|
|
|
+ return !isTopPage(path) && !isUsersProtectedPages(path);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|