feat: allow admins to migrate accounts

This commit is contained in:
naskya 2024-03-01 07:47:40 +09:00
parent 945cc87dc7
commit 1d6b1d052d
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
2 changed files with 2 additions and 6 deletions

View file

@ -5,6 +5,8 @@ Critical security updates are indicated by the :warning: icon.
## Unreleased ## Unreleased
- Add ability to hide replies from certain users in timelines - 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 ## v20240229

View file

@ -43,11 +43,6 @@ export const meta = {
code: "NOT_REMOTE", code: "NOT_REMOTE",
id: "4362f8dc-731f-4ad8-a694-be2a88922a24", id: "4362f8dc-731f-4ad8-a694-be2a88922a24",
}, },
adminForbidden: {
message: "Admins cant migrate.",
code: "NOT_ADMIN_FORBIDDEN",
id: "4362e8dc-731f-4ad8-a694-be2a88922a24",
},
noSuchUser: { noSuchUser: {
message: "No such user.", message: "No such user.",
code: "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) => { export default define(meta, paramDef, async (ps, user) => {
if (!ps.moveToAccount) throw new ApiError(meta.errors.noSuchMoveTarget); 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); if (user.movedToUri) throw new ApiError(meta.errors.alreadyMoved);
const { username, host } = parse(ps.moveToAccount); const { username, host } = parse(ps.moveToAccount);