Skip to content

Commit

Permalink
Open camps_all and arts_all for supplier managers (camps and art …
Browse files Browse the repository at this point in the history
…admins) (#947)
  • Loading branch information
NitayRabi authored and amotenko committed May 5, 2018
1 parent 1f25eba commit 2e130cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libs/user_role.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ userRole.isGateManager = function () {
userRole.isAllowedToViewSuppliers = function () {
return (req, res, next) => {
const user = req.user;
if (user.isAdmin || user.isCampManager || user.isGateManager || user.isCampsAdmin) {
if (user.isAdmin || user.isCampManager || user.isGateManager || user.isCampsAdmin || user.isArtInstallationsAdmin) {
next();
} else {
next('route'); //TODO: set redirect route
Expand Down
4 changes: 2 additions & 2 deletions routes/api-18/routers/main.router.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ class MainRouter {
* request => /camps_open
*/
this.router.route('/camps_all')
.get([userRole.isCampsAdmin()],
.get([userRole.isAllowedToViewSuppliers()],
(req, res) => campsService.retrieveDataFor(constants.prototype_camps.THEME_CAMP.id,req.user).then(result => res.status(result.status).json(result.data)));
this.router.route('/prod_dep_all')
.get(userRole.isProdDepsAdmin(),
(req, res) => campsService.retrieveDataFor(constants.prototype_camps.PROD_DEP.id,req.user).then(result => res.status(result.status).json(result.data)));
this.router.route('/art_all')
.get(userRole.isArtInstallationsAdmin(),
.get(userRole.isAllowedToViewSuppliers(),
(req, res) => campsService.retrieveDataFor(constants.prototype_camps.ART_INSTALLATION.id,req.user).then(result => res.status(result.status).json(result.data)));
/**
* TODO - this should move under camps prefix - who uses these api's
Expand Down

0 comments on commit 2e130cb

Please sign in to comment.