Commit 0df7234f authored by Birin Sanchez's avatar Birin Sanchez

Invited users need to be members of the same LDAP groups as the owner.

Signed-off-by: Birin Sanchez's avatarBirin Sanchez <birin.sanchez@puri.sm>
parent ab6db38a
......@@ -89,14 +89,22 @@ class InvitationRegistrationView(RegistrationView):
u_limit.created_date = o_limit.created_date
u_limit.updated_date = o_limit.updated_date
# Generate tunnel creds for invited user if
# owner has tunnel service
# Tunnel activation requires manual
# action from user
if (
o_service == settings.LM_SERVICES.TUNNEL and
o_limit.remaining_use_time().total_seconds() > 0
):
# Tunnel activation requires manual
# action from user
u_limit.is_active = False
u_limit.save()
# Make new user member of same groups as owner
if o_limit.is_active:
if o_service == settings.LM_SERVICES.SOCIAL:
user.set_ldap_group('social')
elif o_service == settings.LM_SERVICES.CHAT:
user.set_ldap_group('chat')
elif o_service == settings.LM_SERVICES.MAIL:
user.set_ldap_group('mail')
elif o_service == settings.LM_SERVICES.XMPP:
user.set_ldap_group('xmpp')
return user
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment