diff --git a/common/models/User-Identity.js b/common/models/User-Identity.js index 9879ac1f29..b6e03d8a24 100644 --- a/common/models/User-Identity.js +++ b/common/models/User-Identity.js @@ -1,6 +1,6 @@ -//var debug = require('debug')('freecc:models:userIdent'); +// var debug = require('debug')('freecc:models:userIdent'); // -//module.exports = function(UserIdent) { +// module.exports = function(UserIdent) { // // UserIdent.observe('before save', function(ctx, next) { // @@ -24,4 +24,4 @@ // } // }); // }); -//}; +// }; diff --git a/common/models/bonfire.json b/common/models/bonfire.json index 8c93dca92b..ae5e5db32a 100644 --- a/common/models/bonfire.json +++ b/common/models/bonfire.json @@ -1,23 +1,44 @@ { "name": "bonfire", "base": "PersistedModel", - "trackChanges": false, "idInjection": true, + "trackChanges": false, "properties": { "name": { "type": "string", "unique": true }, - "difficulty": "string", - "description": "array", - "tests": "array", - "challengeSeed": "array", + "difficulty": { + "type": "string" + }, + "description": { + "type": "array" + }, + "tests": { + "type": "array" + }, + "challengeSeed": { + "type": "array" + }, "MDNlinks": { "type": "array" } }, "validations": [], "relations": {}, - "acls": [], + "acls": [ + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "DENY" + }, + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$authenticated", + "permission": "ALLOW" + } + ], "methods": [] } diff --git a/common/models/challenge.json b/common/models/challenge.json index 7a55364a02..aa6ef85ef3 100644 --- a/common/models/challenge.json +++ b/common/models/challenge.json @@ -1,32 +1,77 @@ { "name": "challenge", "base": "PersistedModel", - "trackChanges": false, "idInjection": true, + "trackChanges": false, "properties": { "name": { "type": "string", "unique": true }, - "difficulty": "string", - "description": "array", - "tests": "array", - "challengeSeed": "array", - "challengeType": "string", - "MDNlinks": "array", - "nameCn": "string", - "descriptionCn": "array", - "nameFr": "string", - "descriptionFr": "array", - "nameRu": "string", - "descriptionRu": "array", - "nameEs": "string", - "descriptionEs": "array", - "namePt": "string", - "descriptionPt": "array" + "difficulty": { + "type": "string" + }, + "description": { + "type": "array" + }, + "tests": { + "type": "array" + }, + "challengeSeed": { + "type": "array" + }, + "challengeType": { + "type": "string" + }, + "MDNlinks": { + "type": "array" + }, + "nameCn": { + "type": "string" + }, + "descriptionCn": { + "type": "array" + }, + "nameFr": { + "type": "string" + }, + "descriptionFr": { + "type": "array" + }, + "nameRu": { + "type": "string" + }, + "descriptionRu": { + "type": "array" + }, + "nameEs": { + "type": "string" + }, + "descriptionEs": { + "type": "array" + }, + "namePt": { + "type": "string" + }, + "descriptionPt": { + "type": "array" + } }, "validations": [], "relations": {}, - "acls": [], + "acls": [ + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "DENY" + }, + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$authenticated", + "permission": "ALLOW" + } + ], "methods": [] -} \ No newline at end of file +} diff --git a/common/models/comment.json b/common/models/comment.json index a0e5803fc3..ada3b000d6 100644 --- a/common/models/comment.json +++ b/common/models/comment.json @@ -1,8 +1,8 @@ { "name": "comment", "base": "PersistedModel", - "trackChanges": false, "idInjection": true, + "trackChanges": false, "properties": { "associatedPost": { "type": "string", @@ -28,7 +28,9 @@ "type": "array", "default": [] }, - "author": {}, + "author": { + "type": {} + }, "comments": { "type": "array", "default": [] @@ -40,6 +42,20 @@ }, "validations": [], "relations": {}, - "acls": [], + "acls": [ + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "DENY" + }, + { + "accessType": "EXECUTE", + "principalType": "ROLE", + "principalId": "$authenticated", + "permission": "ALLOW", + "property": "create" + } + ], "methods": [] } diff --git a/common/models/field-guide.json b/common/models/field-guide.json index 2a35b987d8..b8e734247c 100644 --- a/common/models/field-guide.json +++ b/common/models/field-guide.json @@ -1,8 +1,8 @@ { "name": "fieldGuide", "base": "PersistedModel", - "trackChanges": false, "idInjection": true, + "trackChanges": false, "properties": { "name": { "type": "string", @@ -19,6 +19,19 @@ }, "validations": [], "relations": {}, - "acls": [], + "acls": [ + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "DENY" + }, + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$authenticated", + "permission": "ALLOW" + } + ], "methods": [] } diff --git a/common/models/job.json b/common/models/job.json index 2932fdd872..30f981d4df 100644 --- a/common/models/job.json +++ b/common/models/job.json @@ -1,17 +1,40 @@ { "name": "job", "base": "PersistedModel", - "trackChanges": false, "idInjection": true, + "trackChanges": false, "properties": { - "position": "string", - "company": "string", - "logoUrl": "string", - "postingUrl": "string", - "copy": "array" + "position": { + "type": "string" + }, + "company": { + "type": "string" + }, + "logoUrl": { + "type": "string" + }, + "postingUrl": { + "type": "string" + }, + "copy": { + "type": "array" + } }, "validations": [], "relations": {}, - "acls": [], + "acls": [ + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "DENY" + }, + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$authenticated", + "permission": "ALLOW" + } + ], "methods": [] } diff --git a/common/models/nonprofit.json b/common/models/nonprofit.json index e4347dcc6b..2cfad23d66 100644 --- a/common/models/nonprofit.json +++ b/common/models/nonprofit.json @@ -1,30 +1,71 @@ { "name": "nonprofit", "base": "PersistedModel", - "trackChanges": false, "idInjection": true, + "trackChanges": false, "properties": { "name": { "type": "string", "unique": true }, - "requestedDeliverables": "array", - "whatDoesNonprofitDo": "string", - "websiteLink": "string", - "stakeholderName": "string", - "stakeholderEmail": "string", - "endUser": "string", - "approvedDeliverables": "array", - "projectDescription": "string", - "logoUrl": "string", - "imageUrl": "string", - "estimatedHours": "number", - "interestedCampers": [], - "confirmedCampers": [], - "currentStatus": "string" + "requestedDeliverables": { + "type": "array" + }, + "whatDoesNonprofitDo": { + "type": "string" + }, + "websiteLink": { + "type": "string" + }, + "stakeholderName": { + "type": "string" + }, + "stakeholderEmail": { + "type": "string" + }, + "endUser": { + "type": "string" + }, + "approvedDeliverables": { + "type": "array" + }, + "projectDescription": { + "type": "string" + }, + "logoUrl": { + "type": "string" + }, + "imageUrl": { + "type": "string" + }, + "estimatedHours": { + "type": "number" + }, + "interestedCampers": { + "type": [] + }, + "confirmedCampers": { + "type": [] + }, + "currentStatus": { + "type": "string" + } }, "validations": [], "relations": {}, - "acls": [], + "acls": [ + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "DENY" + }, + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$authenticated", + "permission": "ALLOW" + } + ], "methods": [] } diff --git a/common/models/story.json b/common/models/story.json index b10b87ac31..bdd86a996b 100644 --- a/common/models/story.json +++ b/common/models/story.json @@ -1,8 +1,8 @@ { "name": "story", "base": "PersistedModel", - "trackChanges": false, "idInjection": true, + "trackChanges": false, "properties": { "name": { "type": "string", @@ -41,7 +41,9 @@ "type": "array", "default": [] }, - "author": {}, + "author": { + "type": {} + }, "comments": { "type": "array", "default": [] @@ -57,6 +59,26 @@ }, "validations": [], "relations": {}, - "acls": [], + "acls": [ + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "DENY" + }, + { + "accessType": "READ", + "principalType": "ROLE", + "principalId": "$authenticated", + "permission": "ALLOW" + }, + { + "accessType": "EXECUTE", + "principalType": "ROLE", + "principalId": "$authenticated", + "permission": "ALLOW", + "property": "create" + } + ], "methods": [] } diff --git a/common/models/user.json b/common/models/user.json index 84ee2a1ba6..2811cfce2d 100644 --- a/common/models/user.json +++ b/common/models/user.json @@ -1,28 +1,42 @@ { "name": "user", "base": "User", - "trackChanges": false, - "idInjection": true, "strict": true, + "idInjection": true, + "trackChanges": false, "properties": { "email": { "type": "string", - "lowercase": true, - "trim": true, "index": { "mongodb": { "unique": true, "sparse": true } - } + }, + "lowercase": true, + "trim": true + }, + "password": { + "type": "string" + }, + "facebook": { + "type": "string" + }, + "twitter": { + "type": "string" + }, + "google": { + "type": "string" + }, + "github": { + "type": "string" + }, + "linkedin": { + "type": "string" + }, + "tokens": { + "type": "array" }, - "password": "string", - "facebook": "string", - "twitter": "string", - "google": "string", - "github": "string", - "linkedin": "string", - "tokens": "array", "progressTimestamps": { "type": "array", "default": [] @@ -108,32 +122,56 @@ "type": "string", "default": "" }, - "resetPasswordToken": "string", - "sentSlackInvite": false, - "resetPasswordExpires": "string", - "uncompletedBonfires": "array", - "completedBonfires": [{ - "id": "string", - "name": "string", - "completedWith": "string", - "completedDate": "string", - "solution": "string" - }], - "uncompletedCoursewares": "array", - "completedCoursewares": [{ - "completedDate": { - "type": "string", - "defaultFn": "now" - }, - "id": "string", - "name": "string", - "completedWith": "string", - "solution": "string", - "githubLink": "string", - "verified": "boolean" - }], - "completedFieldGuides": [], - "uncompletedFieldGuides": [], + "resetPasswordToken": { + "type": "string" + }, + "sentSlackInvite": { + "type": { + "type": false + } + }, + "resetPasswordExpires": { + "type": "string" + }, + "uncompletedBonfires": { + "type": "array" + }, + "completedBonfires": { + "type": [ + { + "id": "string", + "name": "string", + "completedWith": "string", + "completedDate": "string", + "solution": "string" + } + ] + }, + "uncompletedCoursewares": { + "type": "array" + }, + "completedCoursewares": { + "type": [ + { + "completedDate": { + "type": "string", + "defaultFn": "now" + }, + "id": "string", + "name": "string", + "completedWith": "string", + "solution": "string", + "githubLink": "string", + "verified": "boolean" + } + ] + }, + "completedFieldGuides": { + "type": [] + }, + "uncompletedFieldGuides": { + "type": [] + }, "currentStreak": { "type": "number", "default": 0 @@ -142,8 +180,10 @@ "type": "number", "default": 0 }, - "needsSomeDataModeled": { "type": "boolean", "default": false}, - + "needsSomeDataModeled": { + "type": "boolean", + "default": false + }, "needsMigration": { "type": "boolean", "default": true @@ -152,34 +192,50 @@ "type": "boolean", "default": true }, - "challengesHash": {}, - "currentChallenge": {}, + "challengesHash": { + "type": {} + }, + "currentChallenge": { + "type": {} + }, "completedChallenges": { - "type": [{ - "completedDate": "number", - "id": "string", - "name": "string", - "completedWith": "string", - "solution": "string", - "githubLink": "string", - "verified": "boolean", - "challengeType": { - "type": "number", - "default": 0 + "type": [ + { + "completedDate": "number", + "id": "string", + "name": "string", + "completedWith": "string", + "solution": "string", + "githubLink": "string", + "verified": "boolean", + "challengeType": { + "type": "number", + "default": 0 + } } - }], + ], "default": [] }, - "uncompletedChallenges": "array" + "uncompletedChallenges": { + "type": "array" + } }, "validations": [], "relations": {}, - "acls": [{ - "accessType": "EXECUTE", - "principalType": "ROLE", - "principalId": "$everyone", - "permission": "ALLOW", - "property": "doesExist" - }], + "acls": [ + { + "accessType": "*", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "DENY" + }, + { + "accessType": "EXECUTE", + "principalType": "ROLE", + "principalId": "$everyone", + "permission": "ALLOW", + "property": "doesExist" + } + ], "methods": [] } diff --git a/server/datasources.json b/server/datasources.json index 4e770f72b3..70084fe218 100644 --- a/server/datasources.json +++ b/server/datasources.json @@ -4,6 +4,7 @@ "connector": "mongodb" }, "mail": { + "name": "mail", "connector": "mail" } }