Skip to content

Commit

Permalink
fix(applications): allow admin access to boardview
Browse files Browse the repository at this point in the history
  • Loading branch information
Rik Smale committed Sep 24, 2024
1 parent 64a5b03 commit 0e86397
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ exports.listBodyApplications = async (req, res) => {
return errors.makeBadRequestError(res, 'bodyId is not a number.');
}

// Only visible to board members
if (!req.permissions.see_boardview[bodyId]) {
// Only visible to board members and admins
if (!req.permissions.see_boardview.global && !req.permissions.see_boardview[bodyId]) {
return errors.makeForbiddenError(res, 'You are not allowed to see this');
}

Expand Down
4 changes: 3 additions & 1 deletion lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ exports.getPermissions = (user, corePermissions, approvePermissions) => {
permissions.apply_general = hasPermission(corePermissions, 'apply:summeruniversity');

permissions.set_board_comment = {};
permissions.see_boardview = {};
permissions.see_boardview = {
global: hasPermission(corePermissions, 'global:approve_members:summeruniversity')
};

const approveBodiesList = getBodiesListFromPermissions(approvePermissions);
const userBodies = user && Array.isArray(user.bodies) ? user.bodies : [];
Expand Down

0 comments on commit 0e86397

Please sign in to comment.