---
title: migrateGrants
description: >-
  Give each identity's account its grant, once ever: the first call that finds
  the identity linked to an account stores the grant, unless that account
  already holds one for the same permission and object, and records that it did.
  Later calls change nothing, so a grant an admin changed or removed since stays
  that way. Answers, per grant, whether it is in place: `false` for an identity
  with no account yet, which a later call can still move once they sign in, and
  for every grant when the site binds no `SVARTZ_DB`.
updated_at: '2026-11-19T13:21:09+01:00'
created_at: '2026-11-19T03:35:41+01:00'
symbol:
  kind: function
  name: migrateGrants
  signatures:
    - >-
      migrateGrants(env: Env$1, grants: readonly
      [[reference/api/auth/server/IdentityGrant|IdentityGrant]][]):
      Promise<boolean[]>
  parameters:
    - name: env
      type: Env$1
    - name: grants
      type: 'readonly [[reference/api/auth/server/IdentityGrant|IdentityGrant]][]'
  returns:
    type: 'Promise<boolean[]>'
  source: >-
    https://github.com/mia-cx/svartz/blob/711f3906a713c8b9a5a572d0f34c85e90c3bc3d1/packages/auth/src/grants.ts#L177
---

# migrateGrants
