Yuki Takei 7 سال پیش
والد
کامیت
882953c30e
1فایلهای تغییر یافته به همراه4 افزوده شده و 17 حذف شده
  1. 4 17
      src/server/models/page.js

+ 4 - 17
src/server/models/page.js

@@ -125,6 +125,8 @@ module.exports = function(crowi) {
     return templateChecker(this.path);
     return templateChecker(this.path);
   };
   };
 
 
+  // TODO abolish
+  // https://weseek.myjetbrains.com/youtrack/issue/GC-1225
   pageSchema.methods.isGrantedFor = function(userData) {
   pageSchema.methods.isGrantedFor = function(userData) {
     if (this.isPublic()) {
     if (this.isPublic()) {
       return true;
       return true;
@@ -562,6 +564,8 @@ module.exports = function(crowi) {
     return templateBody;
     return templateBody;
   };
   };
 
 
+  // TODO refactor
+  // https://weseek.myjetbrains.com/youtrack/issue/GC-1185
   pageSchema.statics.findListByPageIds = function(ids, options) {
   pageSchema.statics.findListByPageIds = function(ids, options) {
     validateCrowi();
     validateCrowi();
 
 
@@ -805,23 +809,6 @@ module.exports = function(crowi) {
     return q;
     return q;
   };
   };
 
 
-  // Instance method でいいのでは
-  pageSchema.statics.pushToGrantedUsers = function(page, userData) {
-
-    return new Promise(function(resolve, reject) {
-      if (!page.grantedUsers || !Array.isArray(page.grantedUsers)) {
-        page.grantedUsers = [];
-      }
-      page.grantedUsers.push(userData);
-      page.save(function(err, data) {
-        if (err) {
-          return reject(err);
-        }
-        return resolve(data);
-      });
-    });
-  };
-
   async function pushRevision(pageData, newRevision, user, grant, grantUserGroupId) {
   async function pushRevision(pageData, newRevision, user, grant, grantUserGroupId) {
     await newRevision.save();
     await newRevision.save();
     debug('Successfully saved new revision', newRevision);
     debug('Successfully saved new revision', newRevision);