A withdrawn consumer keeps its data, in every provider that holds some (hq issue 241)
mssql disables the login, mongodb takes the user's roles, minio revokes the key and keeps the bucket, mailu disables the mailbox, gitea prohibits the login instead of purging the user and their repositories, umami keeps the website. Each provider's create already enables what this locks.
This commit is contained in:
@@ -564,6 +564,16 @@ export class GiteaAdmin {
|
||||
GiteaAdmin.fail(`/teams/${found.id}/members/${username}`, member);
|
||||
}
|
||||
|
||||
/** Withdraw a user and keep everything they own: login prohibited, which ensureUser undoes. */
|
||||
async prohibitLogin(username: string): Promise<void> {
|
||||
const res = await this.request(`/admin/users/${encodeURIComponent(username)}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify({ login_name: username, prohibit_login: true }),
|
||||
});
|
||||
if (res.status === 200 || res.status === 404) return;
|
||||
GiteaAdmin.fail(`/admin/users/${username}`, res);
|
||||
}
|
||||
|
||||
/** Delete a user, purging what they own. A 404 means the mesh already withdrew them — success, not
|
||||
* an error, so a re-run of remove is safe. */
|
||||
async deleteUser(username: string): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user