NEW: API for mass-disabling of idle users#16558
NEW: API for mass-disabling of idle users#16558mrsimpson wants to merge 3 commits intoRocketChat:developfrom
Conversation
|
@geekgonecrazy we talked about this some time ago, here is the PR |
|
I wonder if we should have this as a cron job instead of an endpoint that someone needs to call. |
|
@sampaiodiego sure there should be an option for a job, but this (c/sh)ould be in addition to the API.
I wanted to keep the PR as small as possible, better add a second one. |
|
I can see the use case for both cron job and maybe just a one off. I'd say logical next step for someone in future would be a follow up PR adding options for cron job |
…at/Rocket.Chat into core/deactivate-inactive-users-api
|
@mrsimpson and @rsjr I was reviewing this PR and since a had too many changes to request I decided to create a new PR with my proposal for this: Idk if you want to update this one based on my PR or if we could close this and merge my one. I did some code improvements and changed from the method call to disable user by user to a model method (replacing the find method) to update the users and set as inactive. |
|
Since never logged in users don't count as "idle", is there an option to deactivate account which have never logged in ? |




Partially Closes #9838
tl;dr
Motivation
Users which are not really using the system anymore for many reasons are a pain to operators: They complicate administration, but especially are a concern with respect to security.
This includes users who have not logged in to the application for a certain period of time as well as users which have been created long ago without ever using the system.
What this adds
This PR brings an API for deactivating idle users. The consumer of the API can provide criteria for selecting the users based upon which they shall be deactivated.
Implementation concerns
{ "role": "admin", "daysIdle": 30}lastUpdated. So I assume good performance for the query itself.