Feature: Block and unblock user accounts 

Description 

HR and admins block the account of a user of their company with a reason, an optional note for HR, a first day (now without one) and a day the user may log in again (open without one); days start at 00:00 in the company's time zone. An immediate block ends every session and token of the user at once; a later one applies from the first request after its start, as every login, session request, token and refresh checks for blocks. Nobody blocks themselves, and a block that would leave the company without an active admin is refused. Blocking twice answers 409 instead of lifting the first block, and lifting an ended block answers 409 as well. The user is told of the block and of its lifting. Lifting a block never reactivates the account of an employee who has left.

Impact 

New operations listUserAccountBlocks, blockUserAccount and liftUserAccountBlock below /api/v1/admin/users/{id}/blocks, new table account_block, new notification types security.accountBlocked and security.accountUnblocked.