Checks the signed-in user's permissions, for the pages and components that hide what the server would refuse.
f
can(): boolean
user: Pick<PublicUser, "role"> | null | undefined,
permission: Permission
Checks whether user has permission. A null user, for the signed out,
has none. The server checks again, so this only decides what to show.
Usage
import * as mod from "src/utils/auth/permissions.ts";