Skip to content
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

Merged
merged 5 commits into from
Aug 22, 2017
Merged

Feature/suspend team #45

merged 5 commits into from
Aug 22, 2017

Conversation

jschaul
Copy link
Member

@jschaul jschaul commented Aug 8, 2017

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.

@jschaul jschaul requested a review from tiago-loureiro August 8, 2017 12:52
@jschaul jschaul force-pushed the feature/suspend-team branch 2 times, most recently from a8e2a77 to 1d18a7c Compare August 9, 2017 12:54
@jschaul jschaul force-pushed the feature/suspend-team branch from 1d18a7c to fc1ce7c Compare August 16, 2017 14:34
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.
@jschaul jschaul force-pushed the feature/suspend-team branch from fc1ce7c to b36f432 Compare August 16, 2017 14:36
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
Copy link
Contributor

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

deleteInvitations page = do
e <- ask
let iids = inInvitation <$> DB.resultList page
void $ liftIO $ mapConcurrently (del e) iids
Copy link
Contributor

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

Copy link
Contributor

@tiago-loureiro tiago-loureiro left a 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, :shipit:

@tiago-loureiro tiago-loureiro merged commit 80d6610 into develop Aug 22, 2017
@tiago-loureiro tiago-loureiro deleted the feature/suspend-team branch August 22, 2017 08:21
flokli pushed a commit that referenced this pull request Jul 1, 2020
* Add test

* Make 'active' field patchable

* Make tests marginally more generic.

Co-authored-by: Matthias Fischmann <mf@zerobuzz.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants