Skip to content

Commit 375479c

Browse files
committed
fix: teams access for Topcoder Users
1 parent 3d280e7 commit 375479c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/services/JobService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ deleteJob.schema = Joi.object().keys({
301301
async function searchJobs (currentUser, criteria, options = { returnAll: false }) {
302302
if (!currentUser.hasManagePermission && !currentUser.isMachine && !currentUser.isConnectManager) {
303303
// regular user can only search with filtering by "projectId"
304-
if (!criteria.projectId) {
304+
if (!options.returnAll && !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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ deleteResourceBooking.schema = Joi.object().keys({
265265
async function searchResourceBookings (currentUser, criteria, options = { returnAll: false }) {
266266
if (!currentUser.hasManagePermission && !currentUser.isMachine && !currentUser.isConnectManager) {
267267
// regular user can only search with filtering by "projectId"
268-
if (!criteria.projectId) {
268+
if (!options.returnAll && !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)