The ID of the project to which the role will be scoped
The configuration of the role
Configuration for a custom role.
Optionaldescription?: stringThe name of the resource. Unique within the blueprint. e.g. 'sync-webhook'
The role resource
defineProjectRole('my-project-id', {
name: 'viewer-role',
title: 'Viewer',
appliesToUsers: true,
appliesToRobots: false,
permissions: [{
name: 'sanity-project-cors',
action: 'read',
}],
})
defineProjectRole('my-project-id', {
name: 'ci-deploy-role',
title: 'CI Deploy Role',
appliesToRobots: true,
appliesToUsers: false,
permissions: [{
name: 'sanity-project-cors',
action: 'create',
}, {
name: 'sanity-project-cors',
action: 'delete',
}],
})
defineRobotToken({
name: 'ci-robot',
memberships: [{
resourceType: 'project',
resourceId: 'my-project-id',
roleNames: ['$.resources.ci-deploy-role'],
}],
})
Defines a role that is scoped to the specified project.