This commit is contained in:
2024-08-31 10:34:18 +08:00
parent 97cfae5a18
commit 2ab16853ac
22 changed files with 57 additions and 27 deletions

View File

@@ -9,7 +9,10 @@ import { isNumNaN, parseBigInt } from "../../../../../utils.ts";
export const handler: Handlers = {
async GET(req, ctx) {
const u = <User | undefined> ctx.state.user;
if (u && !u.is_admin && !(u.permissions & UserPermission.ReadGallery)) {
if (
u && !u.is_admin &&
!(Number(u.permissions) & UserPermission.ReadGallery)
) {
return new Response("Permission denied", { status: 403 });
}
const gid = parseBigInt(ctx.params.gid);