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

Commit f5a5b09

Browse files
committed
allow under13 users to see their own profiles
1 parent a71cecb commit f5a5b09

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

profiles.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ module.exports = function (options) {
495495
return champion.id === args.user ? args.user.id : null;
496496
});
497497

498+
profile.requestingOwnProfile = args.user.id === profile.userId;
499+
498500
seneca.act({role: 'cd-users', cmd: 'load_dojo_admins_for_user', userId: profile.userId}, function (err, dojoAdmins) {
499501
if (err) return done(err);
500502
profile.requestingUserIsDojoAdmin = _.find(dojoAdmins, function (dojoAdmin) {
@@ -576,7 +578,7 @@ module.exports = function (options) {
576578
function under13Filter (profile, done) {
577579
// Ensure that only parents of children can retrieve their full public profile
578580
var userId = args.user ? args.user.id : null;
579-
if (_.contains(profile.userTypes, 'attendee-u13') && !_.contains(profile.parents, userId) && !profile.requestingUserIsChampion && !profile.requestingUserIsDojoAdmin) {
581+
if (_.contains(profile.userTypes, 'attendee-u13') && !_.contains(profile.parents, userId) && !profile.requestingUserIsChampion && !profile.requestingUserIsDojoAdmin && !profile.requestingOwnProfile) {
580582
profile = {};
581583
return done(null, profile);
582584
}

0 commit comments

Comments
 (0)