feature: chat is working?
This commit is contained in:
parent
b700251278
commit
200b89954b
9 changed files with 189 additions and 71 deletions
|
@ -1,12 +1,12 @@
|
|||
import * as CANNED_RESPONSES from '../../../../utils/canned_responses.ts';
|
||||
import { get_session, get_user, PRECHECK_TABLE, require_user } from '../../../../utils/prechecks.ts';
|
||||
|
||||
export const PERMISSIONS: Record<string, (req: Request, meta: Record<string, any>) => Promise<boolean>> = {};
|
||||
export const PRECHECKS: PRECHECK_TABLE = {};
|
||||
|
||||
// GET /api/users/me - Get the current user
|
||||
PRECHECKS.GET = [get_session, get_user, require_user, (_req: Request, meta: Record<string, any>): Response | undefined => {
|
||||
const can_read_self = meta.user.permissions.includes('self.read');
|
||||
console.dir({ meta, can_read_self });
|
||||
|
||||
if (!can_read_self) {
|
||||
return CANNED_RESPONSES.permission_denied();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue