Sanity Library Reference Docs
    Preparing search index...

    Function defineRole

    • Beta

      Defines a role that is scoped to the same resource as the blueprint.

      defineRole({
      name: 'custom-robot-role',
      title: 'Custom Robot Role',
      appliesToRobots: true,
      permissions: [{
      name: 'sanity-project-cors',
      action: 'create',
      }],
      })

      Parameters

      • parameters: BlueprintRoleConfig

        The configuration of the role

        Deploying Roles via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.

        Configuration for a custom role. This feature is subject to breaking changes.

        • BetaappliesToRobots: boolean
        • BetaappliesToUsers: boolean
        • Optional Betadescription?: string
        • Betaname: string
        • Betapermissions: RolePermission[]
        • Betatitle: string
      • Optionaloptions: { skipValidation?: boolean }

      Returns BlueprintRoleResource

      The role resource