|
|
@@ -28,6 +28,14 @@ module.exports = function(crowi) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ function isTemplatePath(path) {
|
|
|
+ if (path.match(/.*\/_{1,2}template$/)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
pageSchema = new mongoose.Schema({
|
|
|
path: { type: String, required: true, index: true, unique: true },
|
|
|
revision: { type: ObjectId, ref: 'Revision' },
|
|
|
@@ -96,6 +104,10 @@ module.exports = function(crowi) {
|
|
|
return isPortalPath(this.path);
|
|
|
};
|
|
|
|
|
|
+ pageSchema.methods.isTemplate = function() {
|
|
|
+ return isTemplatePath(this.path);
|
|
|
+ };
|
|
|
+
|
|
|
pageSchema.methods.isCreator = function(userData) {
|
|
|
// ゲスト閲覧の場合は userData に false が入る
|
|
|
if (!userData) {
|