mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-21 04:01:10 +10:00
partial: user routes
This commit is contained in:
@ -184,9 +184,6 @@ class ACLManager {
|
||||
if (!token) return false;
|
||||
if (token.mode != APITokenMode.System) return false;
|
||||
|
||||
// If empty, we just want to check we are an admin *at all*, not specific ACLs
|
||||
if (acls.length == 0) return true;
|
||||
|
||||
for (const acl of acls) {
|
||||
const tokenACLIndex = token.acls.findIndex((e) => e == acl);
|
||||
if (tokenACLIndex != -1) return true;
|
||||
|
||||
@ -17,7 +17,9 @@ type ClientUtils = {
|
||||
|
||||
const NONCE_LENIENCE = 30_000;
|
||||
|
||||
export function defineClientEventHandler<T>(handler: EventHandlerFunction<T>) {
|
||||
export function defineClientEventHandler<R extends EventHandlerRequest = object, K = unknown>(
|
||||
handler: (h3: H3Event<R>, utils: ClientUtils) => Promise<K> | K,
|
||||
) {
|
||||
return defineEventHandler(async (h3) => {
|
||||
const header = getHeader(h3, "Authorization");
|
||||
if (!header) throw createError({ statusCode: 403 });
|
||||
|
||||
@ -46,9 +46,9 @@ class NewsManager {
|
||||
options: {
|
||||
take?: number;
|
||||
skip?: number;
|
||||
orderBy?: "asc" | "desc";
|
||||
orderBy?: "asc" | "desc" | undefined;
|
||||
tags?: string[];
|
||||
search?: string;
|
||||
search?: string | undefined;
|
||||
} = {},
|
||||
) {
|
||||
return await prisma.article.findMany({
|
||||
|
||||
Reference in New Issue
Block a user