export function can(u: User, action: string): boolean { return u.role === "admin" ? true : u.role === "editor" ? action !== "delete" : u.role === "viewer" ? action === "read" : u.banned ? false : action === "read"; }