fix: remove old requiredPerms field

This commit is contained in:
Huskydog9988
2025-05-15 14:21:12 -04:00
parent 59c3b9b76e
commit 831b20d737
3 changed files with 1 additions and 37 deletions

View File

@ -1,4 +1,4 @@
import aclManager, { type SystemACL } from "~/server/internal/acls";
import aclManager from "~/server/internal/acls";
import prisma from "~/server/internal/db/database";
export default defineEventHandler(async (h3) => {
@ -24,36 +24,5 @@ export default defineEventHandler(async (h3) => {
},
});
let i = notifications.length;
while (i--) {
const notif = notifications[i];
const hasPermsForNotif = await aclManager.allowSystemACL(
h3,
notif.requiredPerms as SystemACL,
);
if (!hasPermsForNotif) {
// remove element
console.log(
userId,
"did not have perms to access",
notif.id,
"based on",
notif.requiredPerms,
);
notifications.splice(i, 1);
} else {
console.log(
userId,
"had perms to access",
notif.id,
"based on",
notif.requiredPerms,
);
}
}
return notifications;
});