Skip to content

Commit

Permalink
[BUG] Adding back feature of limiting profiles for users and groups (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
costrouc authored Mar 18, 2022
1 parent 25d94e5 commit 26584cd
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ def render_profile(profile, username, groups):
}
}
"""
# check that username or groups in allowed groups for profile
user_not_in_users = username not in set(profile.get('users', []))
user_not_in_groups = (set(groups) & set(profile.get('groups', []))) == set()
if ('users' in profile or 'groups' in profile) and user_not_in_users and user_not_in_groups:
return None

profile = copy.copy(profile)
profile_kubespawner_override = profile.get("kubespawner_override")
profile["kubespawner_override"] = functools.reduce(
Expand Down

0 comments on commit 26584cd

Please sign in to comment.