Skip to content

Commit cc689ba

Browse files
committed
Merge branch 'develop' into feature/105
2 parents 3c0977b + 4cdcc09 commit cc689ba

14 files changed

Lines changed: 265 additions & 116 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ node_modules
6060

6161
#creds
6262
gcp_creds.json
63+
64+
#certbot
65+
certbot/

apidoc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"defaultVersion": "0.0.8",
55
"description": "Documentation for the API used for mchacks",
66
"title": "hackerAPI documentation",
7-
"url": "https://mchacks.ca/api",
8-
"sampleUrl": "https://mchacks.ca/api"
7+
"url": "https://api.mchacks.ca/api",
8+
"sampleUrl": "https://api.mchacks.ca/api"
99
}

constants/role.constant.js

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ const Constants = {
44
Routes: require("./routes.constant"),
55
};
66
const mongoose = require("mongoose");
7-
const Role = require("../models/role.model");
7+
8+
const accountRole = {
9+
"_id": mongoose.Types.ObjectId(),
10+
"name": "account",
11+
"routes": [
12+
Constants.Routes.authRoutes.login,
13+
Constants.Routes.authRoutes.logout,
14+
Constants.Routes.authRoutes.getSelfRoleBindindings,
15+
Constants.Routes.accountRoutes.getSelf,
16+
Constants.Routes.accountRoutes.getSelfById,
17+
Constants.Routes.accountRoutes.patchSelfById
18+
]
19+
};
820

921
const adminRole = {
1022
"_id": mongoose.Types.ObjectId(),
@@ -16,10 +28,6 @@ const hackerRole = {
1628
"_id": mongoose.Types.ObjectId(),
1729
"name": Constants.General.HACKER,
1830
"routes": [
19-
Constants.Routes.authRoutes.login,
20-
Constants.Routes.authRoutes.logout,
21-
Constants.Routes.authRoutes.getSelfRoleBindindings,
22-
2331
Constants.Routes.accountRoutes.getSelf,
2432
Constants.Routes.accountRoutes.getSelfById,
2533
Constants.Routes.accountRoutes.patchSelfById,
@@ -36,10 +44,6 @@ const volunteerRole = {
3644
"_id": mongoose.Types.ObjectId(),
3745
"name": Constants.General.VOLUNTEER,
3846
"routes": [
39-
Constants.Routes.authRoutes.login,
40-
Constants.Routes.authRoutes.logout,
41-
Constants.Routes.authRoutes.getSelfRoleBindindings,
42-
4347
Constants.Routes.volunteerRoutes.post,
4448

4549
Constants.Routes.hackerRoutes.patchAnyCheckInById,
@@ -51,10 +55,6 @@ const sponsorT1Role = {
5155
"_id": mongoose.Types.ObjectId(),
5256
"name": Constants.General.SPONSOR_T1,
5357
"routes": [
54-
Constants.Routes.authRoutes.login,
55-
Constants.Routes.authRoutes.logout,
56-
Constants.Routes.authRoutes.getSelfRoleBindindings,
57-
5858
Constants.Routes.sponsorRoutes.post,
5959
Constants.Routes.sponsorRoutes.getSelfById,
6060
]
@@ -64,10 +64,6 @@ const sponsorT2Role = {
6464
"_id": mongoose.Types.ObjectId(),
6565
"name": Constants.General.SPONSOR_T2,
6666
"routes": [
67-
Constants.Routes.authRoutes.login,
68-
Constants.Routes.authRoutes.logout,
69-
Constants.Routes.authRoutes.getSelfRoleBindindings,
70-
7167
Constants.Routes.sponsorRoutes.post,
7268
Constants.Routes.sponsorRoutes.getSelfById,
7369
]
@@ -77,10 +73,6 @@ const sponsorT3Role = {
7773
"_id": mongoose.Types.ObjectId(),
7874
"name": Constants.General.SPONSOR_T3,
7975
"routes": [
80-
Constants.Routes.authRoutes.login,
81-
Constants.Routes.authRoutes.logout,
82-
Constants.Routes.authRoutes.getSelfRoleBindindings,
83-
8476
Constants.Routes.sponsorRoutes.post,
8577
Constants.Routes.sponsorRoutes.getSelfById,
8678
]
@@ -90,10 +82,6 @@ const sponsorT4Role = {
9082
"_id": mongoose.Types.ObjectId(),
9183
"name": Constants.General.SPONSOR_T4,
9284
"routes": [
93-
Constants.Routes.authRoutes.login,
94-
Constants.Routes.authRoutes.logout,
95-
Constants.Routes.authRoutes.getSelfRoleBindindings,
96-
9785
Constants.Routes.sponsorRoutes.post,
9886
Constants.Routes.sponsorRoutes.getSelfById,
9987
]
@@ -103,10 +91,6 @@ const sponsorT5Role = {
10391
"_id": mongoose.Types.ObjectId(),
10492
"name": Constants.General.SPONSOR_T5,
10593
"routes": [
106-
Constants.Routes.authRoutes.login,
107-
Constants.Routes.authRoutes.logout,
108-
Constants.Routes.authRoutes.getSelfRoleBindindings,
109-
11094
Constants.Routes.sponsorRoutes.post,
11195
Constants.Routes.sponsorRoutes.getSelfById,
11296
]
@@ -155,14 +139,15 @@ function createAllSingularRoles() {
155139
*/
156140
function createAllRoles() {
157141
let allRolesObject = {
142+
accountRole: accountRole,
158143
adminRole: adminRole,
159144
hackerRole: hackerRole,
160145
volunteerRole: volunteerRole,
161146
sponsorT1Role: sponsorT1Role,
162147
sponsorT2Role: sponsorT2Role,
163148
sponsorT3Role: sponsorT3Role,
164149
sponsorT4Role: sponsorT4Role,
165-
sponsorT5Role: sponsorT5Role
150+
sponsorT5Role: sponsorT5Role,
166151
};
167152

168153
const singularRoles = createAllSingularRoles();
@@ -177,6 +162,7 @@ function createAllRoles() {
177162
}
178163

179164
module.exports = {
165+
accountRole: accountRole,
180166
adminRole: adminRole,
181167
hackerRole: hackerRole,
182168
volunteerRole: volunteerRole,

0 commit comments

Comments
 (0)