diff --git a/actions/challenges.js b/actions/challenges.js index bb4d6ceb9..c7e7ab32e 100755 --- a/actions/challenges.js +++ b/actions/challenges.js @@ -80,8 +80,9 @@ * Changes in 1.31: * - Remove screeningScorecardId and reviewScorecardId from search challenges api. * Changes in 1.32: - * - validateChallenge, getRegistrants, getChallenge, getSubmissions and getPhases functions now check - * if an user belongs to a group via user_group_xref for old challenges and by calling V3 API for new ones. + * - validateChallenge, getRegistrants, getChallenge, getSubmissions, getPhases, searchChallenges and getChallenges + * functions now check if an user belongs to a group via user_group_xref for old challenges and by calling V3 API + * for new ones. */ "use strict"; /*jslint stupid: true, unparam: true, continue: true, nomen: true */ @@ -155,15 +156,22 @@ var CHALLENGE_TYPE_FILTER = ' AND p.project_category_id IN (@filter@)'; * This filter will return all private challenges. * @since 1.24 */ -var ALL_PRIVATE_CHALLENGE_FILTER = ' EXISTS (SELECT contest_id FROM contest_eligibility WHERE contest_id = p.project_id)\n'; +var ALL_PRIVATE_CHALLENGE_FILTER = '(@amIAdmin@ = 0 AND EXISTS (SELECT contest_id FROM contest_eligibility WHERE contest_id = p.project_id))\n'; /** * This filter will return private challenges that given user_id can access. * @since 1.24 */ -var USER_PRIVATE_CHALLENGE_FILTER = ' EXISTS (SELECT contest_id FROM contest_eligibility ce, ' + - 'group_contest_eligibility gce, user_group_xref x WHERE x.login_id = @user_id@ AND x.group_id = gce.group_id ' + - 'AND gce.contest_eligibility_id = ce.contest_eligibility_id AND ce.contest_id = p.project_id)\n'; +var USER_PRIVATE_CHALLENGE_FILTER = ' EXISTS (SELECT contest_id ' + + 'FROM contest_eligibility ce ' + + 'INNER JOIN group_contest_eligibility gce ON gce.contest_eligibility_id = ce.contest_eligibility_id ' + + 'INNER JOIN security_groups sg ON gce.group_id = sg.group_id ' + + 'LEFT JOIN user_group_xref x ON x.group_id = gce.group_id ' + + 'WHERE ce.contest_id = p.project_id AND (' + + '(sg.challenge_group_ind = 0 AND x.login_id = @userId@)' + + 'OR (sg.challenge_group_ind <> 0 AND gce.group_id IN (@myGroups@))' + + ')' + +')\n'; /** * This filter return all private challenges that in specific group. @@ -908,7 +916,8 @@ var searchChallenges = function (api, connection, dbConnectionMap, community, ne total, challengeType, queryName, - challenges; + challenges, + myGroups; for (prop in query) { if (query.hasOwnProperty(prop)) { query[prop.toLowerCase()] = query[prop]; @@ -963,7 +972,17 @@ var searchChallenges = function (api, connection, dbConnectionMap, community, ne sqlParams.user_id = caller.userId || 0; // Check the private challenge access - api.dataAccess.executeQuery('check_eligibility', sqlParams, dbConnectionMap, cb); + api.v3client.getMyGroups(connection, cb); + }, function (groups, cb) { + myGroups = groups; + sqlParams.amIAdmin = connection.caller.accessLevel === 'admin' ? 1 : 0; + sqlParams.myGroups = myGroups; + // Next function uses the passed parameter only to check if it's not empty + if(sqlParams.amIAdmin || !_.isDefined(query.communityId) || _.indexOf(myGroups, query.communityId) !== -1) { + cb(null, [1]); + } else { + api.dataAccess.executeQuery('check_eligibility', sqlParams, dbConnectionMap, cb); + } }, function (results, cb) { if (results.length === 0) { // Return error if the user is not allowed to a specific group(communityId is set) @@ -2310,7 +2329,8 @@ var getChallengeResults = function (api, connection, dbConnectionMap, isStudio, cb(error); return; } - + api.challengeHelper.checkUserChallengeEligibility(connection, challengeId, cb); + }, function (cb) { sqlParams.challengeId = challengeId; api.dataAccess.executeQuery("get_challenge_results_validations", sqlParams, dbConnectionMap, cb); }, function (rows, cb) { @@ -2319,11 +2339,6 @@ var getChallengeResults = function (api, connection, dbConnectionMap, isStudio, return; } - if (rows[0].is_private_challenge) { - cb(new NotFoundError('This is a private challenge. You cannot view it.')); - return; - } - if (!rows[0].is_challenge_finished) { cb(new BadRequestError('You cannot view the results because the challenge is not yet finished or was cancelled.')); return; @@ -3677,7 +3692,8 @@ var getChallenges = function (api, connection, listType, isMyChallenges, next) { result = {}, total, challenges, - index; + index, + myGroups; for (prop in query) { if (query.hasOwnProperty(prop)) { query[prop.toLowerCase()] = query[prop]; @@ -3723,11 +3739,15 @@ var getChallenges = function (api, connection, listType, isMyChallenges, next) { }, function (cb) { validateInputParameterV2(helper, caller, type, query, filter, pageIndex, pageSize, sortColumn, sortOrder, listType, dbConnectionMap, cb); - + }, function (cb) { + api.v3client.getMyGroups(connection, cb); + }, function (groups, cb) { + myGroups = groups; + if (filter.technologies) { filter.tech = filter.technologies.split(',')[0]; } - }, function (cb) { + if (pageIndex === -1) { pageIndex = 1; pageSize = helper.MAX_PAGE_SIZE; @@ -3744,7 +3764,9 @@ var getChallenges = function (api, connection, listType, isMyChallenges, next) { registration_phase_status: helper.LIST_TYPE_REGISTRATION_STATUS_MAP[listType], project_status_id: helper.LIST_TYPE_PROJECT_STATUS_MAP[listType], user_id: caller.userId || 0, - userId: caller.userId || 0 + userId: caller.userId || 0, + amIAdmin: caller.accessLevel === 'admin' ? 1 : 0, + myGroups: myGroups }); if (isMyChallenges) { @@ -3757,7 +3779,11 @@ var getChallenges = function (api, connection, listType, isMyChallenges, next) { } // Check the private challenge access - api.dataAccess.executeQuery('check_eligibility', sqlParams, dbConnectionMap, cb); + if(sqlParams.amIAdmin || !_.isDefined(query.communityId) || _.indexOf(myGroups, query.communityId) !== -1) { + cb(null, [1]); + } else { + api.dataAccess.executeQuery('check_eligibility', sqlParams, dbConnectionMap, cb); + } }, function (results, cb) { if (results.length === 0) { // Return error if the user is not allowed to a specific group(communityId is set) diff --git a/actions/reviewOpportunities.js b/actions/reviewOpportunities.js index ed89b53ef..052296805 100644 --- a/actions/reviewOpportunities.js +++ b/actions/reviewOpportunities.js @@ -1,8 +1,8 @@ /* - * Copyright (C) 2013 - 2014 TopCoder Inc., All Rights Reserved. + * Copyright (C) 2013 - 2017 TopCoder Inc., All Rights Reserved. * - * @version 1.6 - * @author Sky_, Ghost_141, flytoj2ee + * @version 1.7 + * @author Sky_, Ghost_141, flytoj2ee, GFalcon * changes in 1.1 * - Implement the studio review opportunities. * changes in 1.2 @@ -17,6 +17,10 @@ * - Implement the applyStudioReviewOpportunity api. * Changes in 1.6: * - Fix bug in review opportunities api. + * Changes in 1.7: + * - all functions check the right of the current user to view + * or apply to a challenge via user_group_xref for old challenges + * and by calling V3 API for new ones. */ 'use strict'; /*jslint node: true, stupid: true, unparam: true, plusplus: true */ @@ -212,6 +216,7 @@ var getStudioReviewOpportunity = function (api, connection, dbConnectionMap, nex cb(error); return; } + sqlParams.challengeId = challengeId; api.dataAccess.executeQuery('get_studio_review_opportunity_phases', sqlParams, dbConnectionMap, cb); }, function (rows, cb) { @@ -229,6 +234,9 @@ var getStudioReviewOpportunity = function (api, connection, dbConnectionMap, nex duration: getDuration(row.start_time, row.end_time) + ' hours' }); }); + // Check if the user has the right to view the challenge + api.challengeHelper.checkUserChallengeEligibility(connection, challengeId, cb); + }, function (cb) { api.dataAccess.executeQuery('get_studio_review_opportunity_positions', sqlParams, dbConnectionMap, cb); }, function (rows, cb) { if (rows.length !== 0) { @@ -467,6 +475,7 @@ var calculatePayment = function (reviewOpportunityInfo, adjustPayments) { */ var getPaymentValues = function (reviewOpportunityInfo, adjustPayments, isAsc) { var payment = calculatePayment(reviewOpportunityInfo, adjustPayments); + return _.sortBy(payment, function (item) { return (isAsc ? -item : item); }); }; @@ -479,7 +488,7 @@ var getPaymentValues = function (reviewOpportunityInfo, adjustPayments, isAsc) { */ var getReviewOpportunities = function (api, connection, isStudio, next) { var helper = api.helper, result = {}, sqlParams, dbConnectionMap = connection.dbConnectionMap, pageIndex, - pageSize, sortOrder, sortColumn, filter = {}, reviewOpportunities, queryName; + pageSize, sortOrder, sortColumn, filter = {}, reviewOpportunities, queryName, myGroups; pageSize = Number(connection.params.pageSize || helper.MAX_PAGE_SIZE); pageIndex = Number(connection.params.pageIndex || 1); @@ -491,6 +500,11 @@ var getReviewOpportunities = function (api, connection, isStudio, next) { validateInputParameter(helper, connection, filter, isStudio, cb); }, function (cb) { + api.v3client.getMyGroups(connection, cb) + }, + function (groups, cb) { + + myGroups = groups; if (pageIndex === -1) { pageIndex = 1; @@ -512,7 +526,10 @@ var getReviewOpportunities = function (api, connection, isStudio, next) { reviewStartDateSecondDate: filter.reviewStartDate.secondDate, reviewEndDateFirstDate: filter.reviewEndDate.firstDate, reviewEndDateSecondDate: filter.reviewEndDate.secondDate, - challenge_id: 0 + challenge_id: 0, + amIAdmin: connection.caller.accessLevel === 'admin' ? 1 : 0, + myId: (connection.caller.userId || 0), + myGroups: myGroups }; queryName = isStudio ? 'search_studio_review_opportunities' : 'search_software_review_opportunities_data'; @@ -653,7 +670,9 @@ var getSoftwareReviewOpportunity = function (api, connection, next) { }; async.parallel({ - privateCheck: execQuery('check_user_challenge_accessibility'), + privateCheck: function (cbx) { + api.challengeHelper.checkUserChallengeEligibility(connection, challengeId, cbx); + }, reviewCheck: execQuery('check_challenge_review_opportunity') }, cb); }, @@ -664,11 +683,6 @@ var getSoftwareReviewOpportunity = function (api, connection, next) { return; } - if (result.privateCheck[0].is_private && !result.privateCheck[0].has_access) { - cb(new ForbiddenError('The user is not allowed to visit this challenge review opportunity detail.')); - return; - } - async.parallel({ basic: execQuery('get_review_opportunity_detail_basic'), phases: execQuery('get_review_opportunity_detail_phases'), @@ -864,8 +878,8 @@ var applyDevelopReviewOpportunity = function (api, connection, next) { api.dataAccess.executeQuery('check_reviewer', { challenge_id: challengeId, user_id: caller.userId }, dbConnectionMap, cbx); }, privateCheck: function (cbx) { - api.dataAccess.executeQuery('check_user_challenge_accessibility', { challengeId: challengeId, user_id: caller.userId }, dbConnectionMap, cbx); - } + api.challengeHelper.checkUserChallengeEligibility(connection, challengeId, cbx); + }, }, cb); }, function (res, cb) { @@ -875,7 +889,6 @@ var applyDevelopReviewOpportunity = function (api, connection, next) { .map(function (item) { return item.review_application_role_id; }) .uniq() .value(), - privateCheck = res.privateCheck[0], positionsLeft, assignedResourceRoles = res.resourceRoles, currentUserResourceRole = _.filter(assignedResourceRoles, function (item) { return item.user_id === caller.userId; }); @@ -908,13 +921,7 @@ var applyDevelopReviewOpportunity = function (api, connection, next) { return; } - // The caller can't access this private challenge. - if (privateCheck.is_private && !privateCheck.has_access) { - cb(new ForbiddenError('The user is not allowed to register this challenge review.')); - return; - } - - // We only check this when caller is trying to apply review opportunity not cancel them. + // We only check this when caller is trying to apply review opportunity not cancel them. // Get the review resource role that belong to the caller. If the length > 0 then the user is a reviewer already. if (reviewApplicationRoleId.length > 0 && currentUserResourceRole.length > 0) { cb(new BadRequestError('You are already assigned as reviewer for the contest.')); diff --git a/db_scripts/test_eligibility.delete.sql b/db_scripts/test_eligibility.delete.sql index 5f77f6c44..bb51bcc0a 100644 --- a/db_scripts/test_eligibility.delete.sql +++ b/db_scripts/test_eligibility.delete.sql @@ -9,8 +9,30 @@ DATABASE informixoltp; -- UPDATE coder SET comp_country_code = NULL WHERE user_id = 132458; +DATABASE tcs_dw; + +DELETE FROM project WHERE project_id > 4440000 AND project_id < 4440100; + DATABASE tcs_catalog; +DELETE FROM project_info WHERE project_id > 5550000 AND project_id < 5550100; +DELETE FROM project_phase WHERE project_id > 5550000 AND project_id < 5550100; +DELETE FROM project WHERE project_id > 5550000 AND project_id < 5550100; + +DELETE FROM project_info WHERE project_id > 4440000 AND project_id < 4440100; +DELETE FROM project_phase WHERE project_id > 4440000 AND project_id < 4440100; +DELETE FROM prize WHERE project_id > 4440000 AND project_id < 4440100; +DELETE FROM project WHERE project_id > 4440000 AND project_id < 4440100; + +DELETE FROM resource_info WHERE resource_id IN (SELECT resource_id FROM resource WHERE project_id > 3330000 AND project_id < 3330100); +DELETE FROM resource WHERE project_id > 3330000 AND project_id < 3330100; +DELETE FROM project_info WHERE project_id > 3330000 AND project_id < 3330100; +DELETE FROM project_phase WHERE project_id > 3330000 AND project_id < 3330100; +DELETE FROM project WHERE project_id > 3330000 AND project_id < 3330100; +DELETE FROM project_studio_specification WHERE project_studio_spec_id = 3330333; + +DELETE FROM prize WHERE project_id > 1110000 AND project_id < 1110100; +DELETE FROM project_payment_adjustment WHERE project_id > 1110000 AND project_id < 1110100; DELETE FROM notification WHERE project_id > 1110000 AND project_id < 1110100; DELETE FROM project_result WHERE project_id > 1110000 AND project_id < 1110100; DELETE FROM project_user_audit WHERE project_id > 1110000 AND project_id < 1110100; @@ -18,9 +40,12 @@ DELETE FROM component_inquiry WHERE project_id > 1110000 AND project_id < 111010 DELETE FROM resource_info WHERE resource_id IN (SELECT resource_id FROM resource WHERE project_id > 1110000 AND project_id < 1110100); DELETE FROM resource WHERE project_id > 1110000 AND project_id < 1110100; +DELETE FROM review_application WHERE review_auction_id IN (SELECT review_auction_id FROM review_auction WHERE project_id > 1110000 AND project_id < 1110100); +DELETE FROM review_auction WHERE project_id > 1110000 AND project_id < 1110100; DELETE FROM project_info WHERE project_id > 1110000 AND project_id < 1110100; DELETE FROM comp_versions WHERE component_id = 3330333; DELETE FROM comp_catalog WHERE component_id = 3330333; +DELETE FROM phase_criteria WHERE project_phase_id > 1110000 AND project_phase_id < 1110100; DELETE FROM project_phase WHERE project_id > 1110000 AND project_id < 1110100; DELETE FROM project WHERE project_id > 1110000 AND project_id < 1110100; diff --git a/db_scripts/test_eligibility.insert.sql b/db_scripts/test_eligibility.insert.sql index 44a286bf0..e96d96135 100644 --- a/db_scripts/test_eligibility.insert.sql +++ b/db_scripts/test_eligibility.insert.sql @@ -111,16 +111,16 @@ INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_ite INSERT INTO review_item_comment (review_item_comment_id, resource_id, review_item_id, comment_type_id, content, sort, create_user, create_date, modify_user, modify_date) VALUES (7770005, 8880005, 5550005, 1, "The current user has the right to view this challenge", 1, "132456", CURRENT, "132456", CURRENT); -INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) - VALUES (1110001, 1, 14, "132456", CURRENT, "132456", CURRENT); -INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) - VALUES (1110002, 1, 14, "132456", CURRENT, "132456", CURRENT); -INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) - VALUES (1110003, 1, 14, "132456", CURRENT, "132456", CURRENT); -INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) - VALUES (1110004, 1, 14, "132456", CURRENT, "132456", CURRENT); -INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date) - VALUES (1110005, 1, 14, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (1110001, 1, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (1110002, 1, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (1110003, 1, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (1110004, 1, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (1110005, 1, 14, "132456", CURRENT, "132456", CURRENT, 0); INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) VALUES (2220001, 1110001, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); @@ -139,6 +139,17 @@ INSERT INTO comp_catalog (component_id, current_version, component_name, status_ INSERT INTO comp_versions (comp_vers_id, component_id, version, version_text, phase_id, phase_time, price, modify_date) VALUES (4440444, 3330333, 1, "1", 113, CURRENT, 1000, CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 1, "23", "132456", CURRENT, "132456", CURRENT); + INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) VALUES (1110001, 2, "3330333", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) @@ -151,15 +162,15 @@ INSERT INTO project_info (project_id, project_info_type_id, value, create_user, VALUES (1110005, 2, "3330333", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110001, 6, "Not private", "132456", CURRENT, "132456", CURRENT); + VALUES (1110001, 6, "ElTest Not private", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110002, 6, "Old logic - access allowed", "132456", CURRENT, "132456", CURRENT); + VALUES (1110002, 6, "ElTest Old logic - access allowed", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110003, 6, "Old logic - access denied", "132456", CURRENT, "132456", CURRENT); + VALUES (1110003, 6, "ElTest Old logic - access denied", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110004, 6, "New logic - access allowed", "132456", CURRENT, "132456", CURRENT); + VALUES (1110004, 6, "ElTest New logic - access allowed", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) - VALUES (1110005, 6, "New logic - access denied", "132456", CURRENT, "132456", CURRENT); + VALUES (1110005, 6, "ElTest New logic - access denied", "132456", CURRENT, "132456", CURRENT); INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) VALUES (1110001, 26, "---", "132456", CURRENT, "132456", CURRENT); @@ -194,12 +205,315 @@ INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_st INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) VALUES (3330005, 1110005, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 1110001, 4, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 1110002, 4, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 1110003, 4, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 1110004, 4, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 1110005, 4, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO phase_criteria (project_phase_id, phase_criteria_type_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 6, "3", "132456", CURRENT, "132456", CURRENT); +INSERT INTO phase_criteria (project_phase_id, phase_criteria_type_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 6, "3", "132456", CURRENT, "132456", CURRENT); +INSERT INTO phase_criteria (project_phase_id, phase_criteria_type_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 6, "3", "132456", CURRENT, "132456", CURRENT); +INSERT INTO phase_criteria (project_phase_id, phase_criteria_type_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 6, "3", "132456", CURRENT, "132456", CURRENT); +INSERT INTO phase_criteria (project_phase_id, phase_criteria_type_id, parameter, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 6, "3", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO review_auction (review_auction_id, project_id, review_auction_type_id) + VALUES (1110001, 1110001, 1); +INSERT INTO review_auction (review_auction_id, project_id, review_auction_type_id) + VALUES (1110002, 1110002, 1); +INSERT INTO review_auction (review_auction_id, project_id, review_auction_type_id) + VALUES (1110003, 1110003, 1); +INSERT INTO review_auction (review_auction_id, project_id, review_auction_type_id) + VALUES (1110004, 1110004, 1); +INSERT INTO review_auction (review_auction_id, project_id, review_auction_type_id) + VALUES (1110005, 1110005, 1); + +INSERT INTO project_payment_adjustment (project_id, resource_role_id, fixed_amount, multiplier) + VALUES (1110001, 4, 100, 1); +INSERT INTO project_payment_adjustment (project_id, resource_role_id, fixed_amount, multiplier) + VALUES (1110002, 4, 100, 1); +INSERT INTO project_payment_adjustment (project_id, resource_role_id, fixed_amount, multiplier) + VALUES (1110003, 4, 100, 1); +INSERT INTO project_payment_adjustment (project_id, resource_role_id, fixed_amount, multiplier) + VALUES (1110004, 4, 100, 1); +INSERT INTO project_payment_adjustment (project_id, resource_role_id, fixed_amount, multiplier) + VALUES (1110005, 4, 100, 1); + +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (2220001, 1110001, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (2220002, 1110002, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (2220003, 1110003, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (2220004, 1110004, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (2220005, 1110005, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_studio_specification (project_studio_spec_id, create_user, create_date, modify_user, modify_date) + VALUES (3330333, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project (project_id, project_status_id, project_category_id, project_studio_spec_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (3330001, 1, 17, 3330333, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, project_studio_spec_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (3330002, 1, 17, 3330333, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, project_studio_spec_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (3330003, 1, 17, 3330333, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, project_studio_spec_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (3330004, 1, 17, 3330333, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, project_studio_spec_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (3330005, 1, 17, 3330333, "132456", CURRENT, "132456", CURRENT, 0); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (4440001, 3330001, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (4440002, 3330002, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (4440003, 3330003, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (4440004, 3330004, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (4440005, 3330005, 1, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (5550001, 3330001, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (5550002, 3330002, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (5550003, 3330003, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (5550004, 3330004, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (5550005, 3330005, 2, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (8880001, 3330001, 3, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (8880002, 3330002, 3, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (8880003, 3330003, 3, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (8880004, 3330004, 3, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (8880005, 3330005, 3, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (9990001, 3330001, 16, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (9990002, 3330002, 16, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (9990003, 3330003, 16, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (9990004, 3330004, 16, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (9990005, 3330005, 16, 2, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330001, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330002, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330003, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330004, 1, "23", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330005, 1, "23", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330001, 6, "ElTest Studio Not private", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330002, 6, "ElTest Studio Old logic - access allowed", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330003, 6, "ElTest Studio Old logic - access denied", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330004, 6, "ElTest Studio New logic - access allowed", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (3330005, 6, "ElTest Studio New logic - access denied", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 2, 3330001, 5550001, 132456, "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 2, 3330002, 5550002, 132456, "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 2, 3330003, 5550003, 132456, "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 2, 3330004, 5550004, 132456, "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource (resource_id, resource_role_id, project_id, project_phase_id, user_id, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 2, 3330005, 5550005, 132456, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO resource_info (resource_id, resource_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110001, 1, "132456", "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource_info (resource_id, resource_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110002, 1, "132456", "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource_info (resource_id, resource_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110003, 1, "132456", "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource_info (resource_id, resource_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110004, 1, "132456", "132456", CURRENT, "132456", CURRENT); +INSERT INTO resource_info (resource_id, resource_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (1110005, 1, "132456", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (4440001, 4, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (4440002, 4, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (4440003, 4, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (4440004, 4, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (4440005, 4, 14, "132456", CURRENT, "132456", CURRENT, 0); + +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (3330001, 4440001, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (3330002, 4440002, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (3330003, 4440003, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (3330004, 4440004, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO prize (prize_id, project_id, place, prize_amount, prize_type_id, number_of_submissions, create_user, create_date, modify_user, modify_date) + VALUES (3330005, 4440005, 1, 1000, 15, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110011, 4440001, 1, 3, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110012, 4440002, 1, 3, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110013, 4440003, 1, 3, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110014, 4440004, 1, 3, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110015, 4440005, 1, 3, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, actual_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110021, 4440001, 2, 3, CURRENT, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, actual_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110022, 4440002, 2, 3, CURRENT, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, actual_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110023, 4440003, 2, 3, CURRENT, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, actual_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110024, 4440004, 2, 3, CURRENT, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, actual_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110025, 4440005, 2, 3, CURRENT, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440001, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440002, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440003, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440004, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440005, 1, "1", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440001, 6, "ElTest Past Not private", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440002, 6, "ElTest Past Old logic - access allowed", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440003, 6, "ElTest Past Old logic - access denied", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440004, 6, "ElTest Past New logic - access allowed", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (4440005, 6, "ElTest Past New logic - access denied", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (5550001, 2, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (5550002, 2, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (5550003, 2, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (5550004, 2, 14, "132456", CURRENT, "132456", CURRENT, 0); +INSERT INTO project (project_id, project_status_id, project_category_id, create_user, create_date, modify_user, modify_date, tc_direct_project_id) + VALUES (5550005, 2, 14, "132456", CURRENT, "132456", CURRENT, 0); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550001, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550002, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550003, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550004, 1, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550005, 1, "1", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550001, 6, "ElTest Upcoming Not private", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550002, 6, "ElTest Upcoming Old logic - access allowed", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550003, 6, "ElTest Upcoming Old logic - access denied", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550004, 6, "ElTest Upcoming New logic - access allowed", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550005, 6, "ElTest Upcoming New logic - access denied", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550001, 32, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550002, 32, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550003, 32, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550004, 32, "1", "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_info (project_id, project_info_type_id, value, create_user, create_date, modify_user, modify_date) + VALUES (5550005, 32, "1", "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110031, 5550001, 1, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110032, 5550002, 1, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110033, 5550003, 1, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110034, 5550004, 1, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110035, 5550005, 1, 1, CURRENT, CURRENT, 1, "132456", CURRENT, "132456", CURRENT); + +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110041, 5550001, 2, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110042, 5550002, 2, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110043, 5550003, 2, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110044, 5550004, 2, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); +INSERT INTO project_phase (project_phase_id, project_id, phase_type_id, phase_status_id, scheduled_start_time, scheduled_end_time, duration, create_user, create_date, modify_user, modify_date) + VALUES (1110045, 5550005, 2, 1, CURRENT + 7 UNITS DAY, CURRENT + 7 UNITS DAY, 1, "132456", CURRENT, "132456", CURRENT); + DATABASE informixoltp; UPDATE coder SET comp_country_code = ( SELECT MIN(country_code) FROM country WHERE country_name = "United States" ) WHERE coder_id = 132458; +DATABASE tcs_dw; + +INSERT INTO project (project_id, component_name) + VALUES (4440001, "ElTest Past Not private"); +INSERT INTO project (project_id, component_name) + VALUES (4440002, "ElTest Past Old logic - access allowed"); +INSERT INTO project (project_id, component_name) + VALUES (4440003, "ElTest Past Old logic - access denied"); +INSERT INTO project (project_id, component_name) + VALUES (4440004, "ElTest Past New logic - access allowed"); +INSERT INTO project (project_id, component_name) + VALUES (4440005, "ElTest Past New logic - access denied"); + + DATABASE common_oltp; INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110002, 2220002, 0); @@ -228,3 +542,33 @@ INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110013, 3330002); INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110014, 3330003); INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110015, 3330004); + +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110022, 3330002, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110023, 3330003, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110024, 3330004, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110025, 3330005, 1); + +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110022, 3330001); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110023, 3330002); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110024, 3330003); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110025, 3330004); + +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110032, 4440002, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110033, 4440003, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110034, 4440004, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110035, 4440005, 1); + +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110032, 3330001); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110033, 3330002); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110034, 3330003); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110035, 3330004); + +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110042, 5550002, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110043, 5550003, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110044, 5550004, 1); +INSERT INTO contest_eligibility (contest_eligibility_id, contest_id, is_studio) VALUES (1110045, 5550005, 1); + +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110042, 3330001); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110043, 3330002); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110044, 3330003); +INSERT INTO group_contest_eligibility (contest_eligibility_id, group_id) VALUES (1110045, 3330004); diff --git a/docs/Verification_Guide-Improve Challenge Visibility Control.doc b/docs/Verification_Guide-Improve Challenge Visibility Control.doc index fd53c55cc..9e797573a 100644 Binary files a/docs/Verification_Guide-Improve Challenge Visibility Control.doc and b/docs/Verification_Guide-Improve Challenge Visibility Control.doc differ diff --git a/initializers/v3client.js b/initializers/v3client.js index df8312a37..49535ff0c 100644 --- a/initializers/v3client.js +++ b/initializers/v3client.js @@ -92,7 +92,7 @@ function getToken(connection, callback) { * @param {Object} connection - the connection object provided by ActionHero * @param {Number} groupId - the group ID * @param {Function} callback - the callback. Receives either an error - * or the list of group's users an array of numeric IDs + * or the list of group's users as an array of numeric IDs */ function getGroupMembers(connection, groupId, callback) { getToken(connection, function (err, token) { @@ -118,6 +118,38 @@ function getGroupMembers(connection, groupId, callback) { }); } +/** + * Get IDs of groups the specified user belongs to + * + * @param {Object} connection - the connection object provided by ActionHero + * @param {Number} userId - the user ID + * @param {Function} callback - the callback. Receives either an error + * or the list of user's groups as an array of numeric IDs + */ +function getUserGroups(connection, userId, callback) { + getToken(connection, function (err, token) { + if (err) { + callback(err); + return; + } + callService({ + url: v3url + 'groups?memberId=' + userId + '&membershipType=user', + method: 'GET', + headers: { + 'Authorization': 'Bearer ' + token + } + }, function (err, body) { + if (err) { + callback(err); + } else { + callback(null, body.result.content.map(function (item) { + return item.id; + })); + } + }); + }); +} + exports.v3client = function (api, next) { api.v3client = { /** @@ -137,6 +169,10 @@ exports.v3client = function (api, next) { callback(null, members.indexOf(userId) >= 0); } }); + }, + + getMyGroups: function (connection, callback) { + getUserGroups(connection, (connection.caller.userId || 0), callback); } }; next(); diff --git a/queries/get_challenge_results_validations b/queries/get_challenge_results_validations index 1e2acb93d..f9c7cf315 100644 --- a/queries/get_challenge_results_validations +++ b/queries/get_challenge_results_validations @@ -1,10 +1,8 @@ select p.project_id, - ce.contest_eligibility_id IS NOT NULL as is_private_challenge, p.project_status_id IN (4,5,7) as is_challenge_finished, p.project_category_id, pcl.project_type_id from project p -left join contest_eligibility ce on p.project_id = ce.contest_id inner join project_category_lu pcl on p.project_category_id = pcl.project_category_id where p.project_id = @challengeId@ diff --git a/queries/get_open_challenges b/queries/get_open_challenges index 7a581d5f9..56e00225c 100644 --- a/queries/get_open_challenges +++ b/queries/get_open_challenges @@ -98,7 +98,7 @@ AND NVL(pp2.actual_end_time, pp2.scheduled_end_time) BETWEEN TO_DATE('@submissio AND pi1.project_info_type_id = 1 -- external reference id AND pi1.project_id = p.project_id -AND pn.value LIKE ('@challenge_name@') +AND LOWER(pn.value) LIKE ('@challenge_name@') AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) >= @prize_lower_bound@ AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) <= @prize_upper_bound@ AND p.tc_direct_project_id = DECODE(@project_id@, 0, p.tc_direct_project_id, @project_id@) diff --git a/queries/get_open_challenges_count b/queries/get_open_challenges_count index 0b65313d6..c55f71031 100644 --- a/queries/get_open_challenges_count +++ b/queries/get_open_challenges_count @@ -28,7 +28,7 @@ AND pi1.project_info_type_id = 1 -- external reference id AND pi1.project_id = p.project_id AND LOWER(pcl.description) = DECODE('@challenge_type@', '', LOWER(pcl.description), '@challenge_type@') -AND pn.value LIKE ('@challenge_name@') +AND LOWER(pn.value) LIKE ('@challenge_name@') AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) >= @prize_lower_bound@ AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) <= @prize_upper_bound@ AND p.tc_direct_project_id = DECODE(@project_id@, 0, p.tc_direct_project_id, @project_id@) diff --git a/queries/get_past_challenges b/queries/get_past_challenges index 49ff02fcf..283ba4ab6 100644 --- a/queries/get_past_challenges +++ b/queries/get_past_challenges @@ -64,7 +64,6 @@ p.project_status_id IN (4, 5, 6, 7, 8, 9, 10, 11) AND pcl.project_category_id NOT IN (27, 37) AND pcl.project_type_id IN (@track@) and NVL(pp2.actual_end_time, pp2.scheduled_end_time) > '2012-01-01 00:00:00' AND NVL(pp2.actual_end_time, pp2.scheduled_end_time) BETWEEN TO_DATE('@submission_end_from@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@submission_end_to@ 23:59:59', '%Y-%m-%d %H:%M:%S') --- Filter out the challenge that user is not belong to. AND pp1.phase_status_id in (2,3) AND LOWER(pn.value) LIKE('@challenge_name@') -- start of parameters diff --git a/queries/get_past_challenges_count b/queries/get_past_challenges_count index 23b07d5eb..f9085edbd 100644 --- a/queries/get_past_challenges_count +++ b/queries/get_past_challenges_count @@ -25,9 +25,4 @@ AND LOWER(pn.value) LIKE ('@challenge_name@') AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) >= @prize_lower_bound@ AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) <= @prize_upper_bound@ AND p.tc_direct_project_id = DECODE(@project_id@, 0, p.tc_direct_project_id, @project_id@) --- Filter out the challenge that user is not belong to. -AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id) - or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x - where ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = @user_id@) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id - AND ce.contest_id = p.project_id)) AND not exists (select 1 from resource r, project_info pi82 where r.project_id = p.project_id and r.resource_role_id = 1 and p.project_id = pi82.project_id and project_info_type_id = 82 and pi82.value = 1) diff --git a/queries/search_past_software_studio_challenges b/queries/search_past_software_studio_challenges index 53ba42220..f3b5a12ad 100644 --- a/queries/search_past_software_studio_challenges +++ b/queries/search_past_software_studio_challenges @@ -97,16 +97,11 @@ AND p.project_status_id IN (4, 5, 6, 7, 8, 9, 10, 11) AND pcl.project_type_id IN (@project_type_id@) AND NVL(pp.actual_end_time, pp.scheduled_end_time) BETWEEN TO_DATE('@submissionEndFrom@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@submissionEndTo@ 23:59:59', '%Y-%m-%d %H:%M:%S') AND LOWER(pcl.description) = DECODE('@categoryName@', '', LOWER(pcl.description), '@categoryName@') -AND (challenge_name.value) LIKE ('@challengeName@') +AND LOWER(challenge_name.value) LIKE ('@challengeName@') AND NVL(pr.prize_amount, 0) >= @prilower@ AND NVL(pr.prize_amount, 0) <= @priupper@ AND p.tc_direct_project_id = DECODE(@tcdirectid@, 0, p.tc_direct_project_id, @tcdirectid@) AND NVL((cmc_task_id.value), '') = DECODE('@cmc@', '', NVL((cmc_task_id.value), ''), '@cmc@') --- Filter out the challenge that user is not belong to. -AND (not exists (SELECT contest_id FROM contest_eligibility WHERE contest_id = p.project_id) - OR exists(SELECT contest_id FROM contest_eligibility ce, group_contest_eligibility gce, user_group_xref x - WHERE ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = @user_id@) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id - AND ce.contest_id = p.project_id)) and pp.actual_end_time > '2012-01-01 00:00:00' ORDER BY @sortColumn@ @sortOrder@ diff --git a/queries/search_past_software_studio_challenges_count b/queries/search_past_software_studio_challenges_count index 81bd29d3b..90ebf9b16 100644 --- a/queries/search_past_software_studio_challenges_count +++ b/queries/search_past_software_studio_challenges_count @@ -9,10 +9,7 @@ INNER JOIN project_status_lu pstatus ON p.project_status_id = pstatus.project_st INNER JOIN project_category_lu pcl on pcl.project_category_id = p.project_category_id LEFT JOIN project_info pi1 ON pi1.project_id = p.project_id AND pi1.project_info_type_id = 1 -WHERE (not exists (SELECT contest_id FROM contest_eligibility WHERE contest_id = p.project_id) - OR exists(SELECT contest_id FROM contest_eligibility ce, group_contest_eligibility gce, user_group_xref x - WHERE ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = 22655028) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id - AND ce.contest_id = p.project_id)) +WHERE 1=1 AND pcl.project_category_id NOT IN (27, 37) --exclude when spec review was a 'contest.' Also exclude MM, which is in there as a 'software' contest. AND p.project_status_id IN (4, 5, 6, 7, 8, 9, 10, 11) AND pcl.project_type_id in (@project_type_id@) diff --git a/queries/search_software_review_opportunities_data b/queries/search_software_review_opportunities_data index 3db5243db..f6810dd61 100644 --- a/queries/search_software_review_opportunities_data +++ b/queries/search_software_review_opportunities_data @@ -1,5 +1,5 @@ SELECT -* +d.* FROM ( -- software contest review SELECT @@ -167,14 +167,24 @@ AND pp2.phase_status_id IN (2,3) AND pp18.phase_status_id IN (1,2) AND not exists (SELECT 1 FROM project_phase pp12 WHERE pp12.project_id=p.project_id AND pp12.phase_type_id=12) AND dpp.resource_role_id = 21 -) +) d + LEFT JOIN contest_eligibility ce ON ce.contest_id = d.challenge_id + LEFT JOIN group_contest_eligibility gce ON gce.contest_eligibility_id = ce.contest_eligibility_id + LEFT JOIN security_groups sg ON gce.group_id = sg.group_id + LEFT JOIN user_group_xref ugx ON ugx.group_id = gce.group_id WHERE 1=1 -AND LOWER(review_type) = LOWER(DECODE('@reviewType@', '', review_type, '@reviewType@')) -AND LOWER(challenge_name) LIKE LOWER('%@challengeName@%') -AND LOWER(challenge_type) = LOWER(DECODE('@challengeType@', '', challenge_type, '@challengeType@')) -AND review_start BETWEEN TO_DATE('@reviewStartDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@reviewStartDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') -AND review_end BETWEEN TO_DATE('@reviewEndDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@reviewEndDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') -AND number_of_review_positions_available > 0 +AND LOWER(d.review_type) = LOWER(DECODE('@reviewType@', '', d.review_type, '@reviewType@')) +AND LOWER(d.challenge_name) LIKE LOWER('%@challengeName@%') +AND LOWER(d.challenge_type) = LOWER(DECODE('@challengeType@', '', d.challenge_type, '@challengeType@')) +AND d.review_start BETWEEN TO_DATE('@reviewStartDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@reviewStartDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') +AND d.review_end BETWEEN TO_DATE('@reviewEndDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@reviewEndDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') +AND d.number_of_review_positions_available > 0 +-- eligibility check +AND (@amIAdmin@ = 1 + OR ce.contest_id IS NULL + OR (sg.challenge_group_ind = 0 AND ugx.login_id = @myId@) + OR (sg.challenge_group_ind <> 0 AND gce.group_id IN (@myGroups@)) +) ORDER BY @sortColumn@ @sortOrder@ diff --git a/queries/search_software_studio_challenges b/queries/search_software_studio_challenges index 18c7c1370..149baaa21 100644 --- a/queries/search_software_studio_challenges +++ b/queries/search_software_studio_challenges @@ -101,11 +101,6 @@ FIRST @pageSize@ AND p.project_Id = nd_phase.project_id AND nd_phase.phase_type_id = (SELECT MIN(phase_type_id) FROM project_phase WHERE project_id = p.project_id AND phase_status_id = 2 AND phase_type_id not in (13,14)) AND p.project_category_id = pcl.project_category_id - -- Filter out the challenge that user is not belong to. - AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id) - or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x - where ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = 22655028) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id - AND ce.contest_id = p.project_id)) AND pcl.project_category_id NOT IN (27, 37) --exclude when spec review was a 'contest.' Also exclude MM, which is in there as a 'software' contest. -- start of parameters AND pstatus.project_status_id IN (@project_status_id@) diff --git a/queries/search_software_studio_challenges_count b/queries/search_software_studio_challenges_count index ca300b02b..bf338a9be 100644 --- a/queries/search_software_studio_challenges_count +++ b/queries/search_software_studio_challenges_count @@ -48,18 +48,12 @@ SELECT count(*) AS total AND p.project_Id = nd_phase.project_id AND nd_phase.project_phase_id = (SELECT MAX(project_phase_id) FROM project_phase WHERE project_id = p.project_id AND phase_status_id = 2 AND phase_type_id IN (1,2,3,4,5,6,7,8,9,10,11,12)) AND p.project_category_id = pcl.project_category_id - -- Filter out the challenge that user is not belong to. - AND (not exists (select contest_id from contest_eligibility where contest_id = p.project_id) - or exists(select contest_id from contest_eligibility ce, group_contest_eligibility gce, user_group_xref x - where ((gce.group_id < 2000000 AND x.group_id = gce.group_id AND x.login_id = 22655028) OR gce.group_id >= 2000000) AND gce.contest_eligibility_id = ce.contest_eligibility_id - AND ce.contest_id = p.project_id)) AND pcl.project_category_id NOT IN (27, 37) --exclude when spec review was a 'contest.' Also exclude MM, which is in there as a 'software' contest. AND pstatus.project_status_id IN (@project_status_id@) AND pcl.project_type_id IN (@project_type_id@) AND pp1.phase_status_id IN (@registration_phase_status@) AND pp1.scheduled_start_time >= decode (pstatus.project_status_id, 2, current, pp1.scheduled_start_time) AND NVL(pp2.actual_end_time, pp2.scheduled_end_time) BETWEEN TO_DATE('@submissionEndFrom@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@submissionEndTo@ 23:59:59', '%Y-%m-%d %H:%M:%S') - AND LOWER(pcl.description) = DECODE('@categoryName@', '', LOWER(pcl.description), '@categoryName@') AND LOWER(pn.value) LIKE ('@challengeName@') AND NVL((SELECT pr.prize_amount FROM prize pr WHERE pr.project_id = p.project_id AND pr.prize_type_id = 15 AND pr.place = 1), 0) >= @prilower@ diff --git a/queries/search_studio_review_opportunities b/queries/search_studio_review_opportunities index 83266023c..75281ade0 100644 --- a/queries/search_studio_review_opportunities +++ b/queries/search_studio_review_opportunities @@ -1,5 +1,5 @@ SELECT -* +d.* FROM ( -- studio screen review SELECT @@ -43,13 +43,23 @@ WHERE p.project_status_id = 1 AND pcl.project_type_id = 3 AND pps.phase_status_id = 2 AND ppsub.phase_status_id = 1 -) +) d + LEFT JOIN contest_eligibility ce ON ce.contest_id = d.challenge_id + LEFT JOIN group_contest_eligibility gce ON gce.contest_eligibility_id = ce.contest_eligibility_id + LEFT JOIN security_groups sg ON gce.group_id = sg.group_id + LEFT JOIN user_group_xref ugx ON ugx.group_id = gce.group_id WHERE 1=1 -AND LOWER(review_type) = LOWER(DECODE('@reviewType@', '', review_type, '@reviewType@')) -AND LOWER(challenge_name) LIKE LOWER('%@challengeName@%') -AND LOWER(challenge_type) = LOWER(DECODE('@challengeType@', '', challenge_type, '@challengeType@')) -AND round_1_scheduled_start_date BETWEEN TO_DATE('@round1ScheduledStartDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@round1ScheduledStartDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') -AND round_2_scheduled_start_date BETWEEN TO_DATE('@round2ScheduledStartDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@round2ScheduledStartDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') +AND LOWER(d.review_type) = LOWER(DECODE('@reviewType@', '', d.review_type, '@reviewType@')) +AND LOWER(d.challenge_name) LIKE LOWER('%@challengeName@%') +AND LOWER(d.challenge_type) = LOWER(DECODE('@challengeType@', '', d.challenge_type, '@challengeType@')) +AND d.round_1_scheduled_start_date BETWEEN TO_DATE('@round1ScheduledStartDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@round1ScheduledStartDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') +AND d.round_2_scheduled_start_date BETWEEN TO_DATE('@round2ScheduledStartDateFirstDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') AND TO_DATE('@round2ScheduledStartDateSecondDate@ 00:00:00', '%Y-%m-%d %H:%M:%S') +-- eligibility check +AND (@amIAdmin@ = 1 + OR ce.contest_id IS NULL + OR (sg.challenge_group_ind = 0 AND ugx.login_id = @myId@) + OR (sg.challenge_group_ind <> 0 AND gce.group_id IN (@myGroups@)) +) ORDER BY @sortColumn@ @sortOrder@ diff --git a/test/postman/New_Challenge_Visibility_Control.postman_collection.json b/test/postman/New_Challenge_Visibility_Control.postman_collection.json index 3c52fb3e4..20631b0ed 100644 --- a/test/postman/New_Challenge_Visibility_Control.postman_collection.json +++ b/test/postman/New_Challenge_Visibility_Control.postman_collection.json @@ -4,6 +4,19 @@ "description": "", "order": [], "folders": [ + { + "id": "a12cc40f-4ca4-bad5-caea-1ae2cfd77178", + "name": "Apply develop review opportunity", + "description": "", + "order": [ + "30e239bc-9e0e-2a97-0399-9853d7c975e6", + "92d5a6ac-d7fc-79de-c5d4-fd10a79b018e", + "cc1cbe83-a990-ff80-e1fa-0358899198f2", + "bc9566fa-bd94-980a-2b61-813d1340cfa4", + "23b8c76c-9c35-b358-4528-8e1709bcb3e8" + ], + "owner": "316251" + }, { "id": "cada5a0c-766f-dde0-3c9f-d001a67eddd4", "name": "Get challenge", @@ -17,6 +30,32 @@ ], "owner": "316251" }, + { + "id": "7a366938-cb0d-d72c-9417-b89ddfe0c118", + "name": "Get challenge results", + "description": "", + "order": [ + "0786bf2a-c9bf-96ee-a118-67ead2b1455f", + "70050c8d-3db5-9437-7c90-1f1c15ac8a46", + "21d43db1-c228-6827-7a46-e6461bb713fb", + "6dc5c17f-a1d8-ebc8-7549-5208871f72db", + "b7a298cc-2b90-6522-f82b-49d20d22d2bb" + ], + "owner": "316251", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240" + }, + { + "id": "4f202fce-de29-8aad-46e1-ba806709ac52", + "name": "Get challenges", + "description": "", + "order": [ + "247ab2ed-2b95-b175-e608-f50edceb9362", + "9205a134-bc37-29e2-3db8-971b7ac77967", + "83e8261b-f1c3-3e4a-ba71-161e0920a501", + "e34964fd-e868-71a4-e852-31625310c757" + ], + "owner": "316251" + }, { "id": "712ffa63-a959-e4a3-6af9-84d4f236b2f3", "name": "Get checkpoints", @@ -57,6 +96,34 @@ ], "owner": "316251" }, + { + "id": "8cc9f069-2635-6081-ef6f-baf617842ce3", + "name": "Get software review opportunities", + "description": "", + "order": [ + "8d5321d9-a039-cdd3-48a7-9579e45ba662", + "4261978e-2788-4268-1861-d07789751882", + "39daceeb-f95f-d17f-69bf-69f72d7c26a1", + "0d3ba7cd-d432-fa9c-983e-1e81a07a6f42", + "74cdf1ee-8c8d-2dba-a6eb-1b9fa5a7ac6e" + ], + "owner": "316251", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240" + }, + { + "id": "0b5aaf5f-42c8-c27e-64d1-40850629e731", + "name": "Get studio review opportunities", + "description": "", + "order": [ + "5ebf9f3b-84d9-fdcb-cfb4-d26bbdfe45bf", + "bb5cd293-ec53-ec1f-b50c-182111a88aab", + "f074d3f8-29e3-3ba2-1443-94880e0dc8c1", + "215af832-848a-8cbe-2b5f-573ca44b0118", + "1e8d26dc-0ca8-3749-5c2e-915e1befd3ef" + ], + "owner": "316251", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240" + }, { "id": "2a873809-800c-ee71-51ad-94f10096709b", "name": "Get submissions", @@ -84,6 +151,29 @@ ], "owner": "316251" }, + { + "id": "ec385321-d8aa-d1ed-8b5d-991a495f5ea5", + "name": "Search challenges", + "description": "", + "order": [ + "0f2cd89b-df48-b349-b768-c0d75359f2e8", + "6cddf85e-0300-8961-475b-6875e7a7cc94", + "4ee820aa-c05e-94ed-ff5f-491a16ee50f8", + "6593fbc7-0b92-62a1-9456-1b79f1116b7c" + ], + "owner": "316251", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240" + }, + { + "id": "a75c1882-2a5a-8f93-2af5-8e7f552e4c64", + "name": "Search review opportunities", + "description": "", + "order": [ + "851754f0-043d-2145-4b39-47d555a9bffe", + "bd0a5b89-bfc7-4f0c-ed41-a46351fc2c02" + ], + "owner": "316251" + }, { "id": "0eeb693c-c6b6-e23b-156d-cff5f21dbb27", "name": "login", @@ -128,6 +218,101 @@ "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, + { + "id": "0786bf2a-c9bf-96ee-a118-67ead2b1455f", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/result/4440001", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498254891698, + "name": "No groups (challenge is not private)", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "0d3ba7cd-d432-fa9c-983e-1e81a07a6f42", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110004", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218134168, + "name": "New logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "0f2cd89b-df48-b349-b768-c0d75359f2e8", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/design/challenges?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498249335711, + "name": "Studio", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "1af5c911-4627-ad92-085c-63e6fc7b6d9e", "headers": "Authorization: Bearer {{authToken}}\n", @@ -157,7 +342,7 @@ "responses": [] }, { - "id": "2af8f0d9-f3e8-c58a-ca3d-1130e4b07371", + "id": "1e8d26dc-0ca8-3749-5c2e-915e1befd3ef", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -167,7 +352,7 @@ "enabled": true } ], - "url": "{{url}}/develop/challenges/checkpoint/2220003", + "url": "{{url}}/design/reviewOpportunities/3330005", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -175,18 +360,111 @@ "method": "GET", "data": null, "dataMode": "params", + "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497550652259, + "time": 1498147418116, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "215af832-848a-8cbe-2b5f-573ca44b0118", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/design/reviewOpportunities/3330004", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498147402100, + "name": "New logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "21d43db1-c228-6827-7a46-e6461bb713fb", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/result/4440003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498254961664, "name": "Old logic, access denied", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "23b8c76c-9c35-b358-4528-8e1709bcb3e8", + "headers": "Authorization: Bearer {{authToken}}\nContent-Type: application/json\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110005/apply", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218619120, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [], - "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + "rawModeData": "{\n\t\"reviewApplicationRoleId\": \"1\"\n}" }, { - "id": "3246a996-e8f9-5e60-79b9-8aeffcd5392f", + "id": "247ab2ed-2b95-b175-e608-f50edceb9362", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -196,7 +474,7 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110003", + "url": "{{url}}/challenges/active", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -204,17 +482,18 @@ "method": "GET", "data": null, "dataMode": "params", + "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497958076427, - "name": "Old logic, access denied", + "time": 1498248914110, + "name": "Active", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, { - "id": "42b84596-9d5a-50e7-76be-c1ad23f98468", + "id": "2af8f0d9-f3e8-c58a-ca3d-1130e4b07371", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -224,7 +503,7 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110002", + "url": "{{url}}/develop/challenges/checkpoint/2220003", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -235,14 +514,624 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497957969156, - "name": "Old logic, access allowed", + "time": 1497550652259, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + }, + { + "id": "30e239bc-9e0e-2a97-0399-9853d7c975e6", + "headers": "Authorization: Bearer {{authToken}}\nContent-Type: application/json\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110001/apply", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218392399, + "name": "No groups (challenge is not private)", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "rawModeData": "{\n\t\"reviewApplicationRoleId\": \"1\"\n}" + }, + { + "id": "3246a996-e8f9-5e60-79b9-8aeffcd5392f", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497958076427, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "39daceeb-f95f-d17f-69bf-69f72d7c26a1", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218096242, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "4261978e-2788-4268-1861-d07789751882", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218104222, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "42b84596-9d5a-50e7-76be-c1ad23f98468", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497957969156, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "46cf305a-8251-66aa-391c-46def82773a1", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110005/register", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497813578982, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "4b64d85a-4c08-8ec2-9c3f-50605bd2e09e", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110001/register", + "queryParams": [], + "pathVariables": {}, + "pathVariableData": [], + "preRequestScript": null, + "method": "POST", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "data": null, + "dataMode": "params", + "name": "No groups (challenge is not private)", + "description": "", + "descriptionFormat": "html", + "time": 1497813014785, + "version": 2, + "responses": [], + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "folder": "cfbf928f-56b8-9813-f8f3-4ac4e342d965" + }, + { + "id": "4ee820aa-c05e-94ed-ff5f-491a16ee50f8", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498249357470, + "name": "Studio and Software", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "5224f722-9f4f-07bb-58e7-351512cc66ea", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110002/register", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497813399305, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "5ebf9f3b-84d9-fdcb-cfb4-d26bbdfe45bf", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/design/reviewOpportunities/3330001", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498147241389, + "name": "No groups (challenge is not private)", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "60ae89de-4eb1-c0aa-b866-b28b52436e89", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/1110003/register", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497813480606, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "6593fbc7-0b92-62a1-9456-1b79f1116b7c", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges?challengeName=ElTest&listtype=PAST", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + }, + { + "key": "listtype", + "value": "PAST", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498249368414, + "name": "Past", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "6bed8920-6800-0ae0-e63d-b39b05c7f50c", + "headers": "Content-Type: application/json\n", + "url": "{{url}}/auth", + "preRequestScript": null, + "pathVariables": {}, + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1474159263289, + "name": "Login as admin user", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "rawModeData": "{\n \"username\": \"heffan\", \n \"password\": \"password\"\n}", + "folder": "0eeb693c-c6b6-e23b-156d-cff5f21dbb27" + }, + { + "id": "6cddf85e-0300-8961-475b-6875e7a7cc94", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498249348509, + "name": "Software", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "6dc5c17f-a1d8-ebc8-7549-5208871f72db", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/result/4440004", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498254985316, + "name": "New logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "70050c8d-3db5-9437-7c90-1f1c15ac8a46", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/result/4440002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498254935504, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "70b3453b-1d1a-e411-f8e5-527edb0a2530", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/registrants/1110002", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1497934833132, + "name": "Old logic, access allowed", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "74cdf1ee-8c8d-2dba-a6eb-1b9fa5a7ac6e", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110005", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218178618, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, + { + "id": "7c7643c6-89ab-641e-b67a-32b3ac91e09e", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/challenges/checkpoint/2220001", + "queryParams": [], + "pathVariables": {}, + "pathVariableData": [], + "preRequestScript": null, + "method": "GET", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "data": null, + "dataMode": "params", + "name": "No groups (challenge is not private)", + "description": "", + "descriptionFormat": "html", + "time": 1497550504090, + "version": 2, + "responses": [], + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + }, + { + "id": "83e8261b-f1c3-3e4a-ba71-161e0920a501", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/upcoming", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498249612829, + "name": "Upcoming", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, { - "id": "46cf305a-8251-66aa-391c-46def82773a1", + "id": "843d6759-0cc0-a0c6-9fde-60f893f56eac", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -252,7 +1141,7 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110005/register", + "url": "{{url}}/challenges/1110004/register", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -264,14 +1153,14 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497813578982, - "name": "New logic, access denied", + "time": 1497813524683, + "name": "New logic, access allowed", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, { - "id": "4b64d85a-4c08-8ec2-9c3f-50605bd2e09e", + "id": "851754f0-043d-2145-4b39-47d555a9bffe", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -281,28 +1170,34 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110001/register", - "queryParams": [], + "url": "{{url}}/design/reviewOpportunities?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, "pathVariables": {}, "pathVariableData": [], - "preRequestScript": null, - "method": "POST", - "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "method": "GET", "data": null, "dataMode": "params", - "name": "No groups (challenge is not private)", - "description": "", - "descriptionFormat": "html", - "time": 1497813014785, "version": 2, - "responses": [], "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "folder": "cfbf928f-56b8-9813-f8f3-4ac4e342d965" + "time": 1498204539465, + "name": "Studio", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] }, { - "id": "5224f722-9f4f-07bb-58e7-351512cc66ea", + "id": "8d5321d9-a039-cdd3-48a7-9579e45ba662", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -312,26 +1207,26 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110002/register", + "url": "{{url}}/develop/reviewOpportunities/1110001", "queryParams": [], "preRequestScript": null, "pathVariables": {}, "pathVariableData": [], - "method": "POST", + "method": "GET", "data": null, "dataMode": "params", "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497813399305, - "name": "Old logic, access allowed", + "time": 1498218039588, + "name": "No groups (challenge is not private)", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, { - "id": "60ae89de-4eb1-c0aa-b866-b28b52436e89", + "id": "9205a134-bc37-29e2-3db8-971b7ac77967", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -341,47 +1236,70 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110003/register", - "queryParams": [], + "url": "{{url}}/challenges/open?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], "preRequestScript": null, "pathVariables": {}, "pathVariableData": [], - "method": "POST", + "method": "GET", "data": null, "dataMode": "params", "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497813480606, - "name": "Old logic, access denied", + "time": 1498249401889, + "name": "Open", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, { - "id": "6bed8920-6800-0ae0-e63d-b39b05c7f50c", - "headers": "Content-Type: application/json\n", - "url": "{{url}}/auth", + "id": "92d5a6ac-d7fc-79de-c5d4-fd10a79b018e", + "headers": "Authorization: Bearer {{authToken}}\nContent-Type: application/json\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110002/apply", + "queryParams": [], "preRequestScript": null, "pathVariables": {}, + "pathVariableData": [], "method": "POST", "data": [], "dataMode": "raw", "version": 2, - "tests": "var authResponse = JSON.parse(responseBody);\npostman.setEnvironmentVariable(\"authToken\", authResponse.token);\ntests[\"Status code is 200\"] = responseCode.code === 200;\nvar jsonData = JSON.parse(responseBody);\ntests[\"A valid token is returned\"] = !!jsonData.token;", + "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1474159263289, - "name": "Login as admin user", + "time": 1498218503646, + "name": "Old logic, access allowed", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [], - "rawModeData": "{\n \"username\": \"heffan\", \n \"password\": \"password\"\n}", - "folder": "0eeb693c-c6b6-e23b-156d-cff5f21dbb27" + "rawModeData": "{\n\t\"reviewApplicationRoleId\": \"1\"\n}" }, { - "id": "70b3453b-1d1a-e411-f8e5-527edb0a2530", + "id": "a3ae5124-2077-4ff2-4e02-afae7670bbe5", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -391,7 +1309,7 @@ "enabled": true } ], - "url": "{{url}}/challenges/registrants/1110002", + "url": "{{url}}/develop/challenges/checkpoint/2220005", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -402,14 +1320,15 @@ "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497934833132, - "name": "Old logic, access allowed", + "time": 1497550755372, + "name": "New logic, access denied", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", - "responses": [] + "responses": [], + "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" }, { - "id": "7c7643c6-89ab-641e-b67a-32b3ac91e09e", + "id": "b3cb44e7-3e5f-897e-5d6f-6179afc52653", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -419,28 +1338,25 @@ "enabled": true } ], - "url": "{{url}}/develop/challenges/checkpoint/2220001", + "url": "{{url}}/challenges/registrants/1110005", "queryParams": [], + "preRequestScript": null, "pathVariables": {}, "pathVariableData": [], - "preRequestScript": null, "method": "GET", - "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "data": null, "dataMode": "params", - "name": "No groups (challenge is not private)", - "description": "", - "descriptionFormat": "html", - "time": 1497550504090, - "version": 2, - "responses": [], "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + "time": 1497935002619, + "name": "New logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] }, { - "id": "843d6759-0cc0-a0c6-9fde-60f893f56eac", + "id": "b7a298cc-2b90-6522-f82b-49d20d22d2bb", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -450,26 +1366,25 @@ "enabled": true } ], - "url": "{{url}}/challenges/1110004/register", + "url": "{{url}}/develop/challenges/result/4440005", "queryParams": [], "preRequestScript": null, "pathVariables": {}, "pathVariableData": [], - "method": "POST", + "method": "GET", "data": null, "dataMode": "params", - "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497813524683, - "name": "New logic, access allowed", + "time": 1498255007073, + "name": "New logic, access denied", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, { - "id": "a3ae5124-2077-4ff2-4e02-afae7670bbe5", + "id": "bb5cd293-ec53-ec1f-b50c-182111a88aab", "headers": "Authorization: Bearer {{authToken}}\n", "headerData": [ { @@ -479,7 +1394,7 @@ "enabled": true } ], - "url": "{{url}}/develop/challenges/checkpoint/2220005", + "url": "{{url}}/design/reviewOpportunities/3330002", "queryParams": [], "preRequestScript": null, "pathVariables": {}, @@ -487,43 +1402,51 @@ "method": "GET", "data": null, "dataMode": "params", + "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497550755372, - "name": "New logic, access denied", + "time": 1498147297080, + "name": "Old logic, access allowed", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", - "responses": [], - "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" + "responses": [] }, { - "id": "b3cb44e7-3e5f-897e-5d6f-6179afc52653", - "headers": "Authorization: Bearer {{authToken}}\n", + "id": "bc9566fa-bd94-980a-2b61-813d1340cfa4", + "headers": "Authorization: Bearer {{authToken}}\nContent-Type: application/json\n", "headerData": [ { "key": "Authorization", "value": "Bearer {{authToken}}", "description": "", "enabled": true + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "", + "enabled": true } ], - "url": "{{url}}/challenges/registrants/1110005", + "url": "{{url}}/develop/reviewOpportunities/1110004/apply", "queryParams": [], "preRequestScript": null, "pathVariables": {}, "pathVariableData": [], - "method": "GET", - "data": null, - "dataMode": "params", + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, "tests": null, "currentHelper": "normal", "helperAttributes": {}, - "time": 1497935002619, - "name": "New logic, access denied", + "time": 1498218589287, + "name": "New logic, access allowed", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", - "responses": [] + "responses": [], + "rawModeData": "{\n\t\"reviewApplicationRoleId\": \"1\"\n}" }, { "id": "bcc821a7-0e3a-3454-d900-12af0cc94656", @@ -556,6 +1479,43 @@ "helperAttributes": {}, "folder": "6a038555-23cd-e79f-1d34-0fb860e305a3" }, + { + "id": "bd0a5b89-bfc7-4f0c-ed41-a46351fc2c02", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498211029200, + "name": "Software", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "bf83e2d2-549b-361e-f5cf-66a40d816f0c", "headers": "Authorization: Bearer {{authToken}}\n", @@ -672,6 +1632,42 @@ "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, + { + "id": "cc1cbe83-a990-ff80-e1fa-0358899198f2", + "headers": "Authorization: Bearer {{authToken}}\nContent-Type: application/json\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + }, + { + "key": "Content-Type", + "value": "application/json", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/develop/reviewOpportunities/1110003/apply", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "POST", + "data": [], + "dataMode": "raw", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498218550163, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [], + "rawModeData": "{\n\t\"reviewApplicationRoleId\": \"1\"\n}" + }, { "id": "d3e5ca45-334d-fb54-1fd7-46f8e7b82841", "headers": "Authorization: Bearer {{authToken}}\n", @@ -757,6 +1753,43 @@ "responses": [], "folder": "712ffa63-a959-e4a3-6af9-84d4f236b2f3" }, + { + "id": "e34964fd-e868-71a4-e852-31625310c757", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/challenges/past?challengeName=ElTest", + "queryParams": [ + { + "key": "challengeName", + "value": "ElTest", + "equals": true, + "description": "", + "enabled": true + } + ], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498252881840, + "name": "Past", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "e97dac4e-c786-27b1-5e4b-fff50b6de93a", "headers": "Authorization: Bearer {{authToken}}\n", @@ -785,6 +1818,35 @@ "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", "responses": [] }, + { + "id": "f074d3f8-29e3-3ba2-1443-94880e0dc8c1", + "headers": "Authorization: Bearer {{authToken}}\n", + "headerData": [ + { + "key": "Authorization", + "value": "Bearer {{authToken}}", + "description": "", + "enabled": true + } + ], + "url": "{{url}}/design/reviewOpportunities/3330003", + "queryParams": [], + "preRequestScript": null, + "pathVariables": {}, + "pathVariableData": [], + "method": "GET", + "data": null, + "dataMode": "params", + "version": 2, + "tests": null, + "currentHelper": "normal", + "helperAttributes": {}, + "time": 1498147315438, + "name": "Old logic, access denied", + "description": "", + "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", + "responses": [] + }, { "id": "f545bbfc-36d7-6567-25a8-b4d6634575e7", "headers": "Authorization: Bearer {{authToken}}\n", @@ -896,7 +1958,8 @@ "name": "New logic, access denied", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", - "responses": [] + "responses": [], + "folder": "2a873809-800c-ee71-51ad-94f10096709b" }, { "id": "f8e9d38f-8d8d-6e63-4978-6e3546f20b7c", @@ -924,7 +1987,8 @@ "name": "New logic, access allowed", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", - "responses": [] + "responses": [], + "folder": "2a873809-800c-ee71-51ad-94f10096709b" }, { "id": "f90179ed-98da-be6d-77ae-9e3aa4199b5c", @@ -953,7 +2017,8 @@ "name": "No groups (challenge is not private)", "description": "", "collectionId": "ba962be9-0d58-f187-8809-008a39bc2240", - "responses": [] + "responses": [], + "folder": "2a873809-800c-ee71-51ad-94f10096709b" }, { "id": "f915c206-b3fe-a4be-1094-bc8a448cb467", diff --git a/test/scripts/mock_v3.js b/test/scripts/mock_v3.js index 8df5e8c02..3557ba8cb 100644 --- a/test/scripts/mock_v3.js +++ b/test/scripts/mock_v3.js @@ -10,6 +10,7 @@ var express = require('express'); var bodyParser = require('body-parser'); +var _ = require('underscore'); var app = express(); @@ -70,4 +71,21 @@ app.get('/v3/groups/:groupId/members', function (req, res) { } }); +/* + * Get all groups the given user belongs to + * This mock always returns a list consisting of one group + * (3330003) + */ +/*jslint unparam: true*/ +app.get('/v3/groups', function (req, res) { + res.json({ + result: { + content: [{ + id: 3330003 + }] + } + }); +}); +/*jslint unparam: false*/ + app.listen(8084);