Skip to content

Commit 4062f60

Browse files
committed
fix: teams access for Topcoder Users, 2
1 parent 375479c commit 4062f60

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/services/JobService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,9 @@ deleteJob.schema = Joi.object().keys({
299299
* @returns {Object} the search result, contain total/page/perPage and result array
300300
*/
301301
async function searchJobs (currentUser, criteria, options = { returnAll: false }) {
302-
if (!currentUser.hasManagePermission && !currentUser.isMachine && !currentUser.isConnectManager) {
302+
if (!currentUser.hasManagePermission && !currentUser.isMachine && !currentUser.isConnectManager && !options.returnAll) {
303303
// regular user can only search with filtering by "projectId"
304-
if (!options.returnAll && !criteria.projectId) {
304+
if (!criteria.projectId) {
305305
throw new errors.ForbiddenError('Not allowed without filtering by "projectId"')
306306
}
307307
// check if user can access the project

src/services/ResourceBookingService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ deleteResourceBooking.schema = Joi.object().keys({
263263
* @returns {Object} the search result, contain total/page/perPage and result array
264264
*/
265265
async function searchResourceBookings (currentUser, criteria, options = { returnAll: false }) {
266-
if (!currentUser.hasManagePermission && !currentUser.isMachine && !currentUser.isConnectManager) {
266+
if (!currentUser.hasManagePermission && !currentUser.isMachine && !currentUser.isConnectManager && !options.returnAll) {
267267
// regular user can only search with filtering by "projectId"
268-
if (!options.returnAll && !criteria.projectId) {
268+
if (!criteria.projectId) {
269269
throw new errors.ForbiddenError('Not allowed without filtering by "projectId"')
270270
}
271271
// check if user can access the project

0 commit comments

Comments
 (0)