Skip to content

Conversation

@jsenning
Copy link
Member

@jsenning jsenning commented Jul 9, 2024

Generalize privacy settings for items appearing in a user's profile.

This is a large PR and reflects work done during two consecutive summer practicums. It supersedes PR #1042 and #937 and is partnered with PR gordon-cs/gordon-360-ui#2355 in gordon-360-ui.

See gordon-cs/gordon-360-ui#2355 for a description. In particular, the conversation includes comments that probably should be in this conversation as they address how privacy is implemented in the API.

ArabellaJi and others added 28 commits May 23, 2024 10:39
Generalized user privacy variable names and
defined values for isPrivate to be PUBLIC
or PRIVATE rather than False or True in
Combined Profile View Model
@jsenning jsenning marked this pull request as ready for review July 10, 2024 21:09
@jsenning jsenning requested a review from russtuck July 10, 2024 21:09
russtuck
russtuck previously approved these changes Jul 7, 2025
russtuck
russtuck previously approved these changes Jul 7, 2025
@russtuck
Copy link
Member

russtuck commented Jul 7, 2025

@jsenning I can't assign the review to you (as the author), but please review my changes from today.

/// user making the request.</param>
/// <returns>True if the user making the request is authorized to see
/// profile information for students, and false otherwise.</returns>
public bool CanISeeStudents(IEnumerable<AuthGroup> viewerGroups)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming of these methods is confusing, and it's odd that they're in AccountService since they aren't related to account data.

I think these would make more sense as extension methods on the type IEnumerable<AuthGroup> (probably in the Auth folder), since they are essentially methods for a set of auth groups. For example, this would become:

Suggested change
public bool CanISeeStudents(IEnumerable<AuthGroup> viewerGroups)
public static class AuthGroupExtensions {
public static bool CanViewStudents(this IEnumerable<AuthGroup> viewerGroups) {
if (viewerGroups.Contains(AuthGroup.SiteAdmin) ||
viewerGroups.Contains(AuthGroup.Police) ||
viewerGroups.Contains(AuthGroup.FacStaff) ||
viewerGroups.Contains(AuthGroup.Student))
{
return true;
}
return false;
}
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be deleted, since it no longer serves any purpose.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still enforces KeepPrivate for students. It is used in the Housing/Apartment code (which I don't believe is being used).

@jsenning
Copy link
Member Author

jsenning commented Jul 14, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s24 Summer Practicum 2024 s25 worked on in Summer Practicum 2025

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants