Skip to content

Commit ff30126

Browse files
committed
PM-1499 - allow PMs to fetch & edit any copilot requests
1 parent 8218b87 commit ff30126

File tree

1 file changed

+1
-8
lines changed
  • src/routes/copilotRequest

1 file changed

+1
-8
lines changed

src/routes/copilotRequest/get.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import _ from 'lodash';
22

33
import models from '../../models';
4-
import { ADMIN_ROLES } from '../../constants';
54
import util from '../../util';
65
import { PERMISSION } from '../../permissions/constants';
76

@@ -16,16 +15,10 @@ module.exports = [
1615
return next(err);
1716
}
1817

19-
const isAdmin = util.hasRoles(req, ADMIN_ROLES);
20-
21-
const userId = req.authUser.userId;
2218
const copilotRequestId = _.parseInt(req.params.copilotRequestId);
2319

2420
// Admin can see all requests and the PM can only see requests created by them
25-
const whereCondition = _.assign({},
26-
isAdmin ? {} : { createdBy: userId },
27-
{ id: copilotRequestId },
28-
);
21+
const whereCondition = { id: copilotRequestId };
2922

3023
return models.CopilotRequest.findOne({
3124
where: whereCondition,

0 commit comments

Comments
 (0)