forked from enviPath/enviPy
adjusted migration
Initial bayer app Show Pack Classification Adjusted docker compose to bayer specifics Adjusted Dockerfile for Bayer Adding secret flags to group, add secret pools to packages Adjusted View for Package creation Prep configs, added Package Create Modal wip More on PES wip wip
This commit is contained in:
@ -80,6 +80,30 @@ def entra_callback(request):
|
||||
|
||||
login(request, u)
|
||||
|
||||
# EDIT START
|
||||
# Ensure groups exists in eP
|
||||
for id, name in s.ENTRA_SECRET_GROUPS.items():
|
||||
if not Group.objects.filter(uuid=id).exists():
|
||||
g = GroupManager.create_group(User.objects.get(username="admin"), name, f"Synced Entra Group {name} ", uuid=id)
|
||||
else:
|
||||
g = Group.objects.get(uuid=id)
|
||||
# Ensure its secret
|
||||
g.secret = True
|
||||
g.save()
|
||||
|
||||
for id, name in s.ENTRA_GROUPS.items():
|
||||
if not Group.objects.filter(uuid=id).exists():
|
||||
g = GroupManager.create_group(User.objects.get(username="admin"), name, f"Synced Entra Group {name} ", uuid=id)
|
||||
else:
|
||||
g = Group.objects.get(uuid=id)
|
||||
|
||||
for group_uuid in claims.get("groups", []):
|
||||
if Group.objects.filter(uuid=group_uuid).exists():
|
||||
g = Group.objects.get(uuid=group_uuid)
|
||||
g.user_member.add(u)
|
||||
|
||||
# EDIT END
|
||||
|
||||
return redirect(s.SERVER_URL) # Handle errors
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user