mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
fix group page permissions for global mods
This commit is contained in:
@@ -82,7 +82,12 @@ groupsController.details = function(req, res, callback) {
|
||||
posts: function(next) {
|
||||
groups.getLatestMemberPosts(res.locals.groupName, 10, req.uid, next);
|
||||
},
|
||||
isAdminOrGlobalMod: async.apply(user.isAdminOrGlobalMod, req.uid)
|
||||
isAdmin:function(next) {
|
||||
user.isAdministrator(req.uid, next);
|
||||
},
|
||||
isGlobalMod: function(next) {
|
||||
user.isGlobalModerator(req.uid, next);
|
||||
}
|
||||
}, next);
|
||||
}
|
||||
], function(err, results) {
|
||||
@@ -93,7 +98,7 @@ groupsController.details = function(req, res, callback) {
|
||||
if (!results.group) {
|
||||
return callback();
|
||||
}
|
||||
results.group.isOwner = results.group.isOwner || results.isAdminOrGlobalMod;
|
||||
results.group.isOwner = results.group.isOwner || results.isAdmin || (results.isGlobalMod && !results.group.system);
|
||||
results.title = '[[pages:group, ' + results.group.displayName + ']]';
|
||||
results.breadcrumbs = helpers.buildBreadcrumbs([{text: '[[pages:groups]]', url: '/groups' }, {text: results.group.displayName}]);
|
||||
results.allowPrivateGroups = parseInt(meta.config.allowPrivateGroups, 10) === 1;
|
||||
|
||||
Reference in New Issue
Block a user