File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -299,9 +299,9 @@ deleteJob.schema = Joi.object().keys({
299
299
* @returns {Object } the search result, contain total/page/perPage and result array
300
300
*/
301
301
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 ) {
303
303
// regular user can only search with filtering by "projectId"
304
- if ( ! options . returnAll && ! criteria . projectId ) {
304
+ if ( ! criteria . projectId ) {
305
305
throw new errors . ForbiddenError ( 'Not allowed without filtering by "projectId"' )
306
306
}
307
307
// check if user can access the project
Original file line number Diff line number Diff line change @@ -263,9 +263,9 @@ deleteResourceBooking.schema = Joi.object().keys({
263
263
* @returns {Object } the search result, contain total/page/perPage and result array
264
264
*/
265
265
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 ) {
267
267
// regular user can only search with filtering by "projectId"
268
- if ( ! options . returnAll && ! criteria . projectId ) {
268
+ if ( ! criteria . projectId ) {
269
269
throw new errors . ForbiddenError ( 'Not allowed without filtering by "projectId"' )
270
270
}
271
271
// check if user can access the project
You can’t perform that action at this time.
0 commit comments