Skip to content

Commit 0d2ab5b

Browse files
author
James Cori
committed
Merge branch 'master' into develop
2 parents bc4ce7a + 9333c26 commit 0d2ab5b

File tree

4 files changed

+23
-36
lines changed

4 files changed

+23
-36
lines changed

src/common/helper.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ async function getProjectDefaultTerms (projectId) {
758758
* @param {Number} projectId The id of the project for which to get the default terms of use
759759
* @returns {Promise<Number>} The billing account ID
760760
*/
761-
async function getProjectBillingInformation (projectId) {
761+
async function getProjectBillingInformation (projectId) {
762762
const token = await getM2MToken()
763763
const projectUrl = `${config.PROJECTS_API_URL}/${projectId}/billingAccount`
764764
try {
@@ -865,7 +865,11 @@ async function _filterChallengesByGroupsAccess (currentUser, challenges) {
865865
async function ensureAccessibleByGroupsAccess (currentUser, challenge) {
866866
const filtered = await _filterChallengesByGroupsAccess(currentUser, [challenge])
867867
if (filtered.length === 0) {
868-
throw new errors.ForbiddenError(`You don't have access to this group!`)
868+
throw new errors.ForbiddenError(`helper ensureAcessibilityToModifiedGroups :: You don't have access to this group!
869+
Current user: ${JSON.stringify(currentUser)}
870+
Challenge: ${JSON.stringify(challenge)}
871+
Filtered: ${JSON.stringify(filtered)}
872+
`)
869873
}
870874
}
871875

src/common/logger.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ logger.decorateWithLogging = (service) => {
9090
_.each(service, (method, name) => {
9191
const params = method.params || getParams(method)
9292
service[name] = async function () {
93-
logger.debug(`ENTER ${name}`)
94-
logger.debug('input arguments')
93+
// logger.debug(`ENTER ${name}`)
94+
// logger.debug('input arguments')
9595
const args = Array.prototype.slice.call(arguments)
9696
logger.debug(util.inspect(_sanitizeObject(_combineObject(params, args))))
9797
try {
9898
const result = await method.apply(this, arguments)
99-
logger.debug(`EXIT ${name}`)
100-
logger.debug('output arguments')
99+
// logger.debug(`EXIT ${name}`)
100+
// logger.debug('output arguments')
101101
if (result !== null && result !== undefined) {
102102
logger.debug(util.inspect(_sanitizeObject(result)))
103103
}
@@ -146,7 +146,7 @@ logger.decorateWithValidators = function (service) {
146146
*/
147147
logger.buildService = (service) => {
148148
logger.decorateWithValidators(service)
149-
logger.decorateWithLogging(service)
149+
// logger.decorateWithLogging(service)
150150
}
151151

152152
module.exports = logger

src/scripts/seed/TimelineTemplate.json

-26
Original file line numberDiff line numberDiff line change
@@ -48,36 +48,10 @@
4848
{
4949
"phaseId": "aa5a3f78-79e0-4bf7-93ff-b11e8f5b398b",
5050
"predecessor": "6950164f-3c5e-4bdc-abc8-22aaf5a1bd49",
51-
"defaultDuration": 259200
52-
},
53-
{
54-
"phaseId": "1c24cfb3-5b0a-4dbd-b6bd-4b0dff5349c6",
55-
"predecessor": "aa5a3f78-79e0-4bf7-93ff-b11e8f5b398b",
56-
"defaultDuration": 86400
57-
},
58-
{
59-
"phaseId": "797a6af7-cd3f-4436-9fca-9679f773bee9",
60-
"predecessor": "1c24cfb3-5b0a-4dbd-b6bd-4b0dff5349c6",
61-
"defaultDuration": 57600
62-
},
63-
{
64-
"phaseId": "3e2afca6-9542-4763-a135-96b33f12c082",
65-
"predecessor": "797a6af7-cd3f-4436-9fca-9679f773bee9",
66-
"defaultDuration": 86400
67-
},
68-
{
69-
"phaseId": "f3acaf26-1dd5-42ae-9f0d-8eb0fd24ae59",
70-
"predecessor": "3e2afca6-9542-4763-a135-96b33f12c082",
71-
"defaultDuration": 86400
72-
},
73-
{
74-
"phaseId": "ad985cff-ad3e-44de-b54e-3992505ba0ae",
75-
"predecessor": "f3acaf26-1dd5-42ae-9f0d-8eb0fd24ae59",
7651
"defaultDuration": 172800
7752
}
7853
]
7954
},
80-
8155
{
8256
"id": "6969125a-a12f-4b89-8de6-e66b0056f36b",
8357
"name": "Marathon Match",

src/services/ChallengeService.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ async function filterChallengesByGroupsAccess (currentUser, challenges) {
8888
async function ensureAccessibleByGroupsAccess (currentUser, challenge) {
8989
const filtered = await filterChallengesByGroupsAccess(currentUser, [challenge])
9090
if (filtered.length === 0) {
91-
throw new errors.ForbiddenError(`You don't have access to this group!`)
91+
throw new errors.ForbiddenError(`ensureAccessibleByGroupsAccess :: You don't have access to this group!
92+
Current User: ${JSON.stringify(currentUser)}
93+
Challenge: ${JSON.stringify(challenge)}
94+
Filtered: ${JSON.stringify(filtered)}
95+
`)
9296
}
9397
}
9498

@@ -108,7 +112,12 @@ async function ensureAcessibilityToModifiedGroups (currentUser, data, challenge)
108112
const updatedGroups = _.difference(_.union(challenge.groups, data.groups), _.intersection(challenge.groups, data.groups))
109113
const filtered = updatedGroups.filter(g => !userGroupsIds.includes(g))
110114
if (filtered.length > 0) {
111-
throw new errors.ForbiddenError(`You don't have access to this group!`)
115+
throw new errors.ForbiddenError(`ensureAcessibilityToModifiedGroups :: You don't have access to this group!
116+
Current User: ${JSON.stringify(currentUser)}
117+
Data: ${JSON.stringify(data)}
118+
Challenge: ${JSON.stringify(challenge)}
119+
Filtered: ${JSON.stringify(filtered)}
120+
`)
112121
}
113122
}
114123

@@ -2054,4 +2063,4 @@ module.exports = {
20542063
deleteChallenge
20552064
}
20562065

2057-
// logger.buildService(module.exports)
2066+
logger.buildService(module.exports)

0 commit comments

Comments
 (0)