mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-29 07:18:08 +09:00
parent
72319e8f1f
commit
428dac79c8
@ -107,6 +107,7 @@ export async function signup(opts: {
|
|||||||
isAdmin:
|
isAdmin:
|
||||||
(await Users.countBy({
|
(await Users.countBy({
|
||||||
host: IsNull(),
|
host: IsNull(),
|
||||||
|
isAdmin: true,
|
||||||
})) === 0,
|
})) === 0,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
@ -35,6 +35,7 @@ export default define(meta, paramDef, async (ps, _me) => {
|
|||||||
const noUsers =
|
const noUsers =
|
||||||
(await Users.countBy({
|
(await Users.countBy({
|
||||||
host: IsNull(),
|
host: IsNull(),
|
||||||
|
isAdmin: true,
|
||||||
})) === 0;
|
})) === 0;
|
||||||
if (!(noUsers || me?.isAdmin)) throw new Error("access denied");
|
if (!(noUsers || me?.isAdmin)) throw new Error("access denied");
|
||||||
|
|
||||||
|
@ -489,6 +489,7 @@ export default define(meta, paramDef, async (ps, me) => {
|
|||||||
requireSetup:
|
requireSetup:
|
||||||
(await Users.countBy({
|
(await Users.countBy({
|
||||||
host: IsNull(),
|
host: IsNull(),
|
||||||
|
isAdmin: true,
|
||||||
})) === 0,
|
})) === 0,
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
|
Loading…
Reference in New Issue
Block a user