Skip to content

Commit

Permalink
add acl controls to models
Browse files Browse the repository at this point in the history
  • Loading branch information
Berkeley Martinez authored and Berkeley Martinez committed Jun 11, 2015
1 parent 147f1d1 commit af90279
Show file tree
Hide file tree
Showing 10 changed files with 359 additions and 121 deletions.
6 changes: 3 additions & 3 deletions common/models/User-Identity.js
Original file line number Diff line number Diff line change
@@ -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) {
//
Expand All @@ -24,4 +24,4 @@
// }
// });
// });
//};
// };
33 changes: 27 additions & 6 deletions common/models/bonfire.json
Original file line number Diff line number Diff line change
@@ -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": []
}
83 changes: 64 additions & 19 deletions common/models/challenge.json
Original file line number Diff line number Diff line change
@@ -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": []
}
}
22 changes: 19 additions & 3 deletions common/models/comment.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "comment",
"base": "PersistedModel",
"trackChanges": false,
"idInjection": true,
"trackChanges": false,
"properties": {
"associatedPost": {
"type": "string",
Expand All @@ -28,7 +28,9 @@
"type": "array",
"default": []
},
"author": {},
"author": {
"type": {}
},
"comments": {
"type": "array",
"default": []
Expand All @@ -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": []
}
17 changes: 15 additions & 2 deletions common/models/field-guide.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "fieldGuide",
"base": "PersistedModel",
"trackChanges": false,
"idInjection": true,
"trackChanges": false,
"properties": {
"name": {
"type": "string",
Expand All @@ -19,6 +19,19 @@
},
"validations": [],
"relations": {},
"acls": [],
"acls": [
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
},
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$authenticated",
"permission": "ALLOW"
}
],
"methods": []
}
37 changes: 30 additions & 7 deletions common/models/job.json
Original file line number Diff line number Diff line change
@@ -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": []
}
73 changes: 57 additions & 16 deletions common/models/nonprofit.json
Original file line number Diff line number Diff line change
@@ -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": []
}
Loading

0 comments on commit af90279

Please sign in to comment.