-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/suspend team #45
Conversation
a8e2a77
to
1d18a7c
Compare
1d18a7c
to
fc1ce7c
Compare
Adds two internal endpoints on brig * /i/teams/:tid/suspend * suspends accounts of all users of a given (binding) team * deletes all existing team invitations * /i/teams/:tid/unsuspend * reactivates all user accounts of a given (binding) team. * Team invitations are _not_ restored and need to be sent out again.
fc1ce7c
to
b36f432
Compare
services/brig/src/Brig/Team/API.hs
Outdated
let iids = inInvitation <$> DB.resultList page | ||
void $ liftIO $ mapConcurrently (del e) iids | ||
when (DB.resultHasMore page) $ | ||
lift (DB.lookupInvitations tid (Just $ last iids) (unsafeRange 100)) >>= deleteInvitations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last
could eventually raise an exception if the list is empty; we can just paginate using nextPage
like is done here
services/brig/src/Brig/Team/API.hs
Outdated
deleteInvitations page = do | ||
e <- ask | ||
let iids = inInvitation <$> DB.resultList page | ||
void $ liftIO $ mapConcurrently (del e) iids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also use mapConcurrently_
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than what was mentioned,
9223e64
to
0a03bfc
Compare
* Add test * Make 'active' field patchable * Make tests marginally more generic. Co-authored-by: Matthias Fischmann <mf@zerobuzz.net>
Adds two internal endpoints on brig
/i/teams/:tid/suspend
- suspends accounts of all users of a given (binding) team, deletes all existing team invitations/i/teams/:tid/unsuspend
- reactivates all user accounts of a given (binding) team. Team invitations are not restored and need to be sent out again.