prevent deletion or suspension of system accounts
This commit is contained in:
parent
934e007698
commit
a790fef261
9 changed files with 72 additions and 3 deletions
11
packages/backend/src/misc/is-system-account.ts
Normal file
11
packages/backend/src/misc/is-system-account.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
/**
|
||||
* Checks if the given user represents a system account, such as instance.actor.
|
||||
*/
|
||||
export function isSystemAccount(user: { readonly username: string }): boolean {
|
||||
return user.username.includes('.');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue