Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 67c7507

Browse files
authored
Add permissions to differenciate adult from parent into kids forum (#226)
* Add permissions to differenciate adult from parent into kids forum * Remove restriction as Parent to be an adult. Children shouldn't have children anyway.
1 parent f098c52 commit 67c7507

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

oauth2.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ module.exports = function (options) {
8484
if (userProfile.userType === 'champion') user.isChampion = true;
8585
if (userProfile.userType === 'attendee-o13') user.isYouthOver13 = true;
8686
if (userProfile.userType === 'mentor') user.isMentor = true;
87-
if (userProfile.userType === 'parent-guardian') user.isParent = true;
87+
if (userProfile.userType === 'parent-guardian') user.isAdult = true;
88+
if (userProfile.children && userProfile.children.length > 0) user.isParent = true;
8889

8990
seneca.act({role: 'cd-dojos', cmd: 'load_usersdojos', query: {userId: user.id}}, function (err, usersDojos) {
9091
if (err) return done(err);
@@ -182,6 +183,7 @@ module.exports = function (options) {
182183
isYouthOver13: user.isYouthOver13,
183184
isMentor: user.isMentor,
184185
isParent: user.isParent,
186+
isAdult: user.isAdult,
185187
isVerified: user.isVerified,
186188
profileId: user.profileId
187189
};

0 commit comments

Comments
 (0)