|
@@ -343,12 +343,6 @@ module.exports = function(crowi, app) {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.then(function() {
|
|
.then(function() {
|
|
|
- return UserGroupRelation.findAllRelationForUser(req.user);
|
|
|
|
|
- }).then(function(groupRelations) {
|
|
|
|
|
- if (groupRelations != null) {
|
|
|
|
|
- renderVars.userRelatedGroups = groupRelations.map(relation => relation.relatedGroup);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
return PageGroupRelation.findByPage(renderVars.page);
|
|
return PageGroupRelation.findByPage(renderVars.page);
|
|
|
}).then((pageGroupRelation) => {
|
|
}).then((pageGroupRelation) => {
|
|
|
if (pageGroupRelation != null) {
|
|
if (pageGroupRelation != null) {
|
|
@@ -431,19 +425,10 @@ module.exports = function(crowi, app) {
|
|
|
function renderPage(pageData, req, res) {
|
|
function renderPage(pageData, req, res) {
|
|
|
// create page
|
|
// create page
|
|
|
if (!pageData) {
|
|
if (!pageData) {
|
|
|
- var userRelatedGroups
|
|
|
|
|
- UserGroupRelation.findAllRelationForUser(req.user)
|
|
|
|
|
- .then((groupRelations) => {
|
|
|
|
|
- userRelatedGroups = groupRelations.map(relation => relation.relatedGroup);
|
|
|
|
|
- return Promise.resolve();
|
|
|
|
|
- }).then(() => {
|
|
|
|
|
- debug('not found page user group resolver : ', userRelatedGroups);
|
|
|
|
|
- return res.render('customlayout-selector/not_found', {
|
|
|
|
|
- author: {},
|
|
|
|
|
- page: false,
|
|
|
|
|
- userRelatedGroups: userRelatedGroups,
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ return res.render('customlayout-selector/not_found', {
|
|
|
|
|
+ author: {},
|
|
|
|
|
+ page: false,
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (pageData.redirectTo) {
|
|
if (pageData.redirectTo) {
|