Choose your language:
    Retrieve a role
    Returns
    Returns a role object.

    Examples

    Example code:
    const SiteClient = require('datocms-client').SiteClient;
    const client = new SiteClient('YOUR-API-TOKEN');
    const roleId = '34';
    client.role.find(roleId)
    .then((role) => {
    console.log(role);
    })
    .catch((error) => {
    console.error(error);
    });
    Returned output:
    > node example.js
    {
    "id": "34",
    "name": "Editor",
    "canEditFavicon": true,
    "canEditSite": true,
    "canEditSchema": true,
    "canManageMenu": true,
    "canEditEnvironment": true,
    "canPromoteEnvironments": true,
    "environmentsAccess": "primary_only",
    "canManageUsers": true,
    "canManageSharedFilters": true,
    "canManageBuildTriggers": true,
    "canManageWebhooks": true,
    "canManageEnvironments": true,
    "canManageSso": true,
    "canAccessAuditLog": true,
    "canManageWorkflows": true,
    "canManageAccessTokens": true,
    "canPerformSiteSearch": true,
    "canAccessBuildEventsLog": true,
    "positiveItemTypePermissions": [
    {
    "itemType": "44",
    "workflow": "approval_by_editors",
    "onStage": "",
    "toStage": "",
    "environment": "main",
    "action": "all",
    "onCreator": "self",
    "localizationScope": "all",
    "locale": "en"
    }
    ],
    "negativeItemTypePermissions": [
    {
    "itemType": "44",
    "workflow": "approval_by_editors",
    "onStage": "",
    "toStage": "",
    "environment": "main",
    "action": "all",
    "onCreator": "self",
    "localizationScope": "all",
    "locale": "en"
    }
    ],
    "positiveUploadPermissions": [
    {
    "environment": "main",
    "action": "all",
    "onCreator": "self",
    "localizationScope": "all",
    "locale": "en"
    }
    ],
    "negativeUploadPermissions": [
    {
    "environment": "main",
    "action": "all",
    "onCreator": "self",
    "localizationScope": "all",
    "locale": "en"
    }
    ],
    "positiveBuildTriggerPermissions": [
    {
    "buildTrigger": "1822"
    }
    ],
    "negativeBuildTriggerPermissions": [
    {
    "buildTrigger": "1822"
    }
    ],
    "meta": {
    "final_permissions": {
    "can_edit_favicon": true,
    "can_edit_site": true,
    "can_edit_schema": true,
    "can_manage_menu": true,
    "can_edit_environment": true,
    "can_promote_environments": true,
    "environments_access": "primary_only",
    "can_manage_users": true,
    "can_manage_shared_filters": true,
    "can_manage_build_triggers": true,
    "can_manage_webhooks": true,
    "can_manage_environments": true,
    "can_manage_sso": true,
    "can_access_audit_log": true,
    "can_manage_workflows": true,
    "can_manage_access_tokens": true,
    "can_perform_site_search": true,
    "can_access_build_events_log": true,
    "positive_item_type_permissions": [
    {
    "item_type": "44",
    "workflow": "approval_by_editors",
    "on_stage": "",
    "to_stage": "",
    "environment": "main",
    "action": "all",
    "on_creator": "self",
    "localization_scope": "all",
    "locale": "en"
    }
    ],
    "negative_item_type_permissions": [
    {
    "item_type": "44",
    "workflow": "approval_by_editors",
    "on_stage": "",
    "to_stage": "",
    "environment": "main",
    "action": "all",
    "on_creator": "self",
    "localization_scope": "all",
    "locale": "en"
    }
    ],
    "positive_upload_permissions": [
    {
    "environment": "main",
    "action": "all",
    "on_creator": "self",
    "localization_scope": "all",
    "locale": "en"
    }
    ],
    "negative_upload_permissions": [
    {
    "environment": "main",
    "action": "all",
    "on_creator": "self",
    "localization_scope": "all",
    "locale": "en"
    }
    ],
    "positive_build_trigger_permissions": [
    {
    "build_trigger": "1822"
    }
    ],
    "negative_build_trigger_permissions": [
    {
    "build_trigger": "1822"
    }
    ]
    }
    },
    "inheritsPermissionsFrom": [
    "34"
    ]
    }