Skip to content

Commit d59207e

Browse files
committed
Revert "Added hackboard role support"
This reverts commit 481d303.
1 parent 481d303 commit d59207e

File tree

5 files changed

+1
-48
lines changed

5 files changed

+1
-48
lines changed

constants/general.constant.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ const SAMPLE_DIET_RESTRICTIONS = [
7272
const HACKER = "Hacker";
7373
const VOLUNTEER = "Volunteer";
7474
const STAFF = "Staff";
75-
const HACKBOARD = "Hackboard";
7675
const SPONSOR = "Sponsor";
7776

7877
const SPONSOR_T1 = "SponsorT1";
@@ -110,9 +109,8 @@ POST_ROLES[SPONSOR_T4] = "postSponsor";
110109
POST_ROLES[SPONSOR_T5] = "postSponsor";
111110
POST_ROLES[VOLUNTEER] = "postVolunteer";
112111
POST_ROLES[STAFF] = "postStaff";
113-
POST_ROLES[HACKBOARD] = "Hackboard";
114112

115-
const USER_TYPES = [HACKER, VOLUNTEER, STAFF, HACKBOARD, SPONSOR];
113+
const USER_TYPES = [HACKER, VOLUNTEER, STAFF, SPONSOR];
116114
const SPONSOR_TIERS = [
117115
SPONSOR_T1,
118116
SPONSOR_T2,
@@ -124,7 +122,6 @@ const EXTENDED_USER_TYPES = [
124122
HACKER,
125123
VOLUNTEER,
126124
STAFF,
127-
HACKBOARD,
128125
SPONSOR_T1,
129126
SPONSOR_T2,
130127
SPONSOR_T3,
@@ -171,9 +168,6 @@ CREATE_ACC_EMAIL_SUBJECTS[
171168
CREATE_ACC_EMAIL_SUBJECTS[
172169
STAFF
173170
] = `You've been invited to create a staff account for ${HACKATHON_NAME}`;
174-
CREATE_ACC_EMAIL_SUBJECTS[
175-
HACKBOARD
176-
] = `You've been invited to create a hackboard account for ${HACKATHON_NAME}`;
177171

178172
const CACHE_TIMEOUT_STATS = 5 * 60 * 1000;
179173
const CACHE_KEY_STATS = "hackerStats";
@@ -217,7 +211,6 @@ module.exports = {
217211
SPONSOR: SPONSOR,
218212
VOLUNTEER: VOLUNTEER,
219213
STAFF: STAFF,
220-
HACKBOARD: HACKBOARD,
221214
SPONSOR_T1: SPONSOR_T1,
222215
SPONSOR_T2: SPONSOR_T2,
223216
SPONSOR_T3: SPONSOR_T3,

constants/role.constant.js

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,12 @@ const accountRole = {
2020
]
2121
};
2222

23-
const hackboardRestrictedRoutes = [ // hackboard permissions is all staff routes minus these routes
24-
Constants.Routes.hackerRoutes.postAnySendWeekOfEmail,
25-
Constants.Routes.hackerRoutes.postSelfSendWeekOfEmail,
26-
Constants.Routes.hackerRoutes.postAnySendDayOfEmail,
27-
Constants.Routes.hackerRoutes.postSelfSendDayOfEmail,
28-
Constants.Routes.hackerRoutes.patchAcceptHackerById,
29-
Constants.Routes.hackerRoutes.patchAcceptHackerByEmail,
30-
Constants.Routes.hackerRoutes.patchAcceptHackerByArrayOfIds,
31-
Constants.Routes.hackerRoutes.patchAnyStatusById,
32-
Constants.Routes.settingsRoutes.getSettings,
33-
Constants.Routes.settingsRoutes.patchSettings
34-
];
35-
3623
const adminRole = {
3724
_id: mongoose.Types.ObjectId.createFromTime(1),
3825
name: Constants.General.STAFF,
3926
routes: Constants.Routes.listAllRoutes()
4027
};
4128

42-
const hackboardRole = {
43-
_id: mongoose.Types.ObjectId.createFromTime(9),
44-
name: "Hackboard",
45-
routes: createHackboardRoutes()
46-
};
47-
4829
const hackerRole = {
4930
_id: mongoose.Types.ObjectId.createFromTime(2),
5031
name: Constants.General.HACKER,
@@ -162,15 +143,6 @@ const singularRoles = createAllSingularRoles();
162143
const allRolesObject = createAllRoles();
163144
const allRolesArray = Object.values(allRolesObject);
164145

165-
function createHackboardRoutes() {
166-
const restrictedRouteIds = new Set(
167-
hackboardRestrictedRoutes.map((route) => route._id.toString())
168-
);
169-
return Constants.Routes.listAllRoutes().filter((route) => {
170-
return !restrictedRouteIds.has(route._id.toString());
171-
});
172-
}
173-
174146
/**
175147
* Creates all the roles that are of a specific uri and request type
176148
* @return {Role[]}
@@ -213,7 +185,6 @@ function createAllRoles() {
213185
let allRolesObject = {
214186
accountRole: accountRole,
215187
adminRole: adminRole,
216-
hackboardRole: hackboardRole,
217188
hackerRole: hackerRole,
218189
volunteerRole: volunteerRole,
219190
sponsorT1Role: sponsorT1Role,
@@ -237,7 +208,6 @@ function createAllRoles() {
237208
module.exports = {
238209
accountRole: accountRole,
239210
adminRole: adminRole,
240-
hackboardRole: hackboardRole,
241211
hackerRole: hackerRole,
242212
volunteerRole: volunteerRole,
243213
sponsorT1Role: sponsorT1Role,

middlewares/auth.middleware.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,6 @@ async function addCreationRoleBindings(req, res, next) {
477477
req.body.account.id,
478478
Constants.Role.adminRole.name
479479
);
480-
} else if (req.body.account.accountType === Constants.General.HACKBOARD) {
481-
await Services.RoleBinding.createRoleBindingByRoleName(
482-
req.body.account.id,
483-
Constants.Role.hackboardRole.name
484-
);
485480
} else {
486481
// Get the default role for the account type given
487482
const roleName =

services/accountConfirmation.service.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ function generateAccountInvitationEmail(address, receiverEmail, type, token) {
172172
emailSubject = Constants.CREATE_ACC_EMAIL_SUBJECTS[Constants.SPONSOR];
173173
} else if (type === Constants.STAFF) {
174174
emailSubject = Constants.CREATE_ACC_EMAIL_SUBJECTS[Constants.STAFF];
175-
} else if (type === Constants.HACKBOARD) {
176-
emailSubject = Constants.CREATE_ACC_EMAIL_SUBJECTS[Constants.HACKBOARD];
177175
}
178176
const handlebarPath = path.join(
179177
__dirname,

tests/util/roleBinding.test.util.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ function createRoleBinding(accountId, accountType = null, specificRoles = []) {
2525
case Constants.General.STAFF:
2626
roleBinding.roles.push(Constants.Role.adminRole);
2727
break;
28-
case Constants.General.HACKBOARD:
29-
roleBinding.roles.push(Constants.Role.hackboardRole);
30-
break;
3128
case Constants.General.SPONSOR_T1:
3229
roleBinding.roles.push(Constants.Role.sponsorT1Role);
3330
break;

0 commit comments

Comments
 (0)