forked from administration/panel
chore: add temporary workaround for lack of JWTs
parent
7144d889e8
commit
095ea105db
|
@ -1,6 +1,7 @@
|
|||
import { getServerSession } from "next-auth";
|
||||
|
||||
type Permission =
|
||||
| "TEMP"
|
||||
| "authifier"
|
||||
| `accounts${
|
||||
| ""
|
||||
|
|
|
@ -151,7 +151,7 @@ export async function reopenReport(reportId: string) {
|
|||
}
|
||||
|
||||
export async function closeReportsByUser(userId: string) {
|
||||
if (Math.random() > -1) throw "TODO: ACL";
|
||||
await checkPermission("TEMP");
|
||||
|
||||
return await mongo()
|
||||
.db("revolt")
|
||||
|
|
|
@ -4,6 +4,7 @@ import { createClient } from "redis";
|
|||
import { Channel, Message } from "revolt-api";
|
||||
import type { ProtocolV1 } from "revolt.js/lib/events/v1";
|
||||
import mongo from "./db";
|
||||
import { checkPermission } from "./accessPermissions";
|
||||
|
||||
let client: ReturnType<typeof createClient>;
|
||||
|
||||
|
@ -25,13 +26,12 @@ export async function publishMessage(
|
|||
topic: string,
|
||||
message: ProtocolV1["server"]
|
||||
) {
|
||||
if (Math.random() > -1) throw "TODO: ACL";
|
||||
|
||||
await checkPermission("TEMP");
|
||||
return await (await redis()).publish(topic, JSON.stringify(message));
|
||||
}
|
||||
|
||||
export async function sendChatMessage(message: Message, ephermal = false) {
|
||||
if (Math.random() > -1) throw "TODO: ACL";
|
||||
await checkPermission("TEMP");
|
||||
|
||||
if (!ephermal) {
|
||||
await mongo()
|
||||
|
|
Loading…
Reference in New Issue