@@ -4,7 +4,19 @@ const Constants = {
44 Routes : require ( "./routes.constant" ) ,
55} ;
66const 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
921const 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 ,
@@ -28,17 +36,14 @@ const hackerRole = {
2836 Constants . Routes . hackerRoutes . getSelfById ,
2937 Constants . Routes . hackerRoutes . getSelfResumeById ,
3038 Constants . Routes . hackerRoutes . patchSelfById ,
39+ Constants . Routes . hackerRoutes . patchSelfConfirmationById
3140 ]
3241} ;
3342
3443const volunteerRole = {
3544 "_id" : mongoose . Types . ObjectId ( ) ,
3645 "name" : Constants . General . VOLUNTEER ,
3746 "routes" : [
38- Constants . Routes . authRoutes . login ,
39- Constants . Routes . authRoutes . logout ,
40- Constants . Routes . authRoutes . getSelfRoleBindindings ,
41-
4247 Constants . Routes . volunteerRoutes . post ,
4348
4449 Constants . Routes . hackerRoutes . patchAnyCheckInById ,
@@ -50,10 +55,6 @@ const sponsorT1Role = {
5055 "_id" : mongoose . Types . ObjectId ( ) ,
5156 "name" : Constants . General . SPONSOR_T1 ,
5257 "routes" : [
53- Constants . Routes . authRoutes . login ,
54- Constants . Routes . authRoutes . logout ,
55- Constants . Routes . authRoutes . getSelfRoleBindindings ,
56-
5758 Constants . Routes . sponsorRoutes . post ,
5859 Constants . Routes . sponsorRoutes . getSelfById ,
5960 ]
@@ -63,10 +64,6 @@ const sponsorT2Role = {
6364 "_id" : mongoose . Types . ObjectId ( ) ,
6465 "name" : Constants . General . SPONSOR_T2 ,
6566 "routes" : [
66- Constants . Routes . authRoutes . login ,
67- Constants . Routes . authRoutes . logout ,
68- Constants . Routes . authRoutes . getSelfRoleBindindings ,
69-
7067 Constants . Routes . sponsorRoutes . post ,
7168 Constants . Routes . sponsorRoutes . getSelfById ,
7269 ]
@@ -76,10 +73,6 @@ const sponsorT3Role = {
7673 "_id" : mongoose . Types . ObjectId ( ) ,
7774 "name" : Constants . General . SPONSOR_T3 ,
7875 "routes" : [
79- Constants . Routes . authRoutes . login ,
80- Constants . Routes . authRoutes . logout ,
81- Constants . Routes . authRoutes . getSelfRoleBindindings ,
82-
8376 Constants . Routes . sponsorRoutes . post ,
8477 Constants . Routes . sponsorRoutes . getSelfById ,
8578 ]
@@ -89,10 +82,6 @@ const sponsorT4Role = {
8982 "_id" : mongoose . Types . ObjectId ( ) ,
9083 "name" : Constants . General . SPONSOR_T4 ,
9184 "routes" : [
92- Constants . Routes . authRoutes . login ,
93- Constants . Routes . authRoutes . logout ,
94- Constants . Routes . authRoutes . getSelfRoleBindindings ,
95-
9685 Constants . Routes . sponsorRoutes . post ,
9786 Constants . Routes . sponsorRoutes . getSelfById ,
9887 ]
@@ -102,10 +91,6 @@ const sponsorT5Role = {
10291 "_id" : mongoose . Types . ObjectId ( ) ,
10392 "name" : Constants . General . SPONSOR_T5 ,
10493 "routes" : [
105- Constants . Routes . authRoutes . login ,
106- Constants . Routes . authRoutes . logout ,
107- Constants . Routes . authRoutes . getSelfRoleBindindings ,
108-
10994 Constants . Routes . sponsorRoutes . post ,
11095 Constants . Routes . sponsorRoutes . getSelfById ,
11196 ]
@@ -154,14 +139,15 @@ function createAllSingularRoles() {
154139 */
155140function createAllRoles ( ) {
156141 let allRolesObject = {
142+ accountRole : accountRole ,
157143 adminRole : adminRole ,
158144 hackerRole : hackerRole ,
159145 volunteerRole : volunteerRole ,
160146 sponsorT1Role : sponsorT1Role ,
161147 sponsorT2Role : sponsorT2Role ,
162148 sponsorT3Role : sponsorT3Role ,
163149 sponsorT4Role : sponsorT4Role ,
164- sponsorT5Role : sponsorT5Role
150+ sponsorT5Role : sponsorT5Role ,
165151 } ;
166152
167153 const singularRoles = createAllSingularRoles ( ) ;
@@ -176,6 +162,7 @@ function createAllRoles() {
176162}
177163
178164module . exports = {
165+ accountRole : accountRole ,
179166 adminRole : adminRole ,
180167 hackerRole : hackerRole ,
181168 volunteerRole : volunteerRole ,
0 commit comments