---
title: can
description: >-
  Whether `account` (`null` for a guest) may do `permission` on `target`: the
  site (`{}`), a vault (`{ vault }`), or a page of one (`{ vault, page }`, by
  the page's slug). Grants on the page, its folders, its vault and the site
  apply, the most specific first; see `resolve` in `permissions.ts` for the
  order.
updated_at: '2026-11-19T13:21:09+01:00'
created_at: '2026-11-19T03:35:41+01:00'
symbol:
  kind: function
  name: can
  signatures:
    - >-
      can(account: [[reference/api/auth/server/Account|Account]] | null,
      permission: `${string}:${string}:read` | `${string}:${string}:write` |
      `${string}:${string}:delete`, target:
      [[reference/api/auth/server/PermissionTarget|PermissionTarget]], env:
      Env$1): Promise<boolean>
  parameters:
    - name: account
      type: '[[reference/api/auth/server/Account|Account]] | null'
    - name: permission
      type: >-
        `${string}:${string}:read` | `${string}:${string}:write` |
        `${string}:${string}:delete`
    - name: target
      type: '[[reference/api/auth/server/PermissionTarget|PermissionTarget]]'
    - name: env
      type: Env$1
  returns:
    type: Promise<boolean>
  source: >-
    https://github.com/mia-cx/svartz/blob/711f3906a713c8b9a5a572d0f34c85e90c3bc3d1/packages/auth/src/grants.ts#L122
---

# can

Fails closed: without `SVARTZ_DB` there are no grants, so it answers `false`, and a failed load throws. A permission
the site's plugins don't declare throws too.
