feat: allow admins to migrate accounts
This commit is contained in:
parent
945cc87dc7
commit
1d6b1d052d
2 changed files with 2 additions and 6 deletions
|
@ -5,6 +5,8 @@ Critical security updates are indicated by the :warning: icon.
|
|||
## Unreleased
|
||||
|
||||
- Add ability to hide replies from certain users in timelines
|
||||
- Admins are now allowed to migrate their account
|
||||
- This was requested by personal server admins
|
||||
|
||||
## v20240229
|
||||
|
||||
|
|
|
@ -43,11 +43,6 @@ export const meta = {
|
|||
code: "NOT_REMOTE",
|
||||
id: "4362f8dc-731f-4ad8-a694-be2a88922a24",
|
||||
},
|
||||
adminForbidden: {
|
||||
message: "Admins cant migrate.",
|
||||
code: "NOT_ADMIN_FORBIDDEN",
|
||||
id: "4362e8dc-731f-4ad8-a694-be2a88922a24",
|
||||
},
|
||||
noSuchUser: {
|
||||
message: "No such user.",
|
||||
code: "NO_SUCH_USER",
|
||||
|
@ -93,7 +88,6 @@ function moveActivity(toUrl: string, fromUrl: string) {
|
|||
|
||||
export default define(meta, paramDef, async (ps, user) => {
|
||||
if (!ps.moveToAccount) throw new ApiError(meta.errors.noSuchMoveTarget);
|
||||
if (user.isAdmin) throw new ApiError(meta.errors.adminForbidden);
|
||||
if (user.movedToUri) throw new ApiError(meta.errors.alreadyMoved);
|
||||
|
||||
const { username, host } = parse(ps.moveToAccount);
|
||||
|
|
Loading…
Reference in a new issue