• HOME
  • INTEGRATIONS
  • SDK
  • API DOCS
No results for ""
EXPAND ALL
CLOSE
launchdarkly.com

EDIT ON GITHUB

Actions in custom roles

Read time: 2 minutes
Last edited: Mar 20, 2020

Overview

This topic explains how to use actions to write policies for custom roles. These actions are scoped by resource type.

To learn more about policies in custom roles, read:

  • Policies in custom roles

  • Example policies

Each resource has a set of actions associated with it that represent changes that you can make to that resource. For example, feature flags have actions like createFlag, deleteFlag, updateName, and more.

Action names generally begin with create, update, or delete.

To learn more about resources, read Resources in custom roles.

You can specify actions in bulk using glob syntax. For example, you can describe all modifications to feature flags with the action specifier update*.

Actions reference

Account actions

ActionDescription
updateOrganizationUpdate the organization name.
updateSubscriptionChange the pricing plan for the account.
updatePaymentCardChange the credit card for the account.
updateRequireMfaChange whether multi-factor authentication (MFA) is required for all users on the account
updateAccountTokenModify account tokens (for the LaunchDarkly REST API.
updateSessionRefreshChange the time a user session will remain active before the user has to re-authenticate
updateSessionDurationChange whether sessions are refreshed automatically
revokeSessionsRevoke all user sessions (logs out all users)

Members actions

member is a top-level action. A code sample is below:

1member/*

To learn more, read Managing teams.

ActionDescription
createMemberAdd a new team member to an account
updateRoleUpdate a team member's built-in roles (reader, writer, or admin)

Tokens actions

token is a child resources of members. A code sample is below:

1member/*:token/*

To learn more, read Personal API access tokens.

Role actions

role is a top-level resource. A code sample is below:

1role/*

To learn more, read Custom roles.

ActionDescription
createRoleCreate new custom roles
updatePolicyUpdate a custom role's policy
updateNameUpdate a custom role's name
deleteRoleDelete a custom role
updateMembersAdd or remove users from a custom role (equivalent to updateCustomRole on team members).

Project actions

proj is a top-level resource.

1proj/*

To learn more, read Projects.

ActionDescription
createProjectCreate a new project
deleteProjectDelete a project
updateProjectNameRename a project
updateIncludeInSnippetByDefaultMake new flags available to the client-side (JavaScript) SDK by default
updateTagsUpdate tags associated with a project
viewProjectView a project. If set to deny, anyone impacted by this policy can neither view nor modify a project. To learn more, read Configuring private projects with custom roles.

Environments actions

env is a child resources of projects. A code sample is below:

1proj/*:env/*

To learn more, read Environments.

ActionDescription
createEnvironmentCreate new environments
deleteEnvironmentDelete an existing environment
updateNameChange the name of an environment
updateColorChange the color swatch for an environment
updateTtlChange the TTL for an environment
updateApiKeyReset the API key for an environment
updateMobileKeyReset the mobile key for an environment
updateSecureModeTurn secure mode on or off for an environment
updateTagsUpdate tags associated with an environment
updateRequireCommentsRequire comments for changes to flags and segments
updateConfirmChangesRequire environment confirmation for changes to flags and segments

Metrics actions

The name of this action has changed

Goals have been redesigned as metrics and associated with our Experimentation add-on. You do not need to update your actions to use metric, however. If you are using goals actions, they will still work.

metric is a child resource of projects. A code sample is below:

1proj/*:metric/*

To learn more, read Experimentation introduction.

ActionDescription
createMetricCreate metrics
deleteMetricDelete metrics
updateKeyUpdate keys for custom metrics
updateNameUpdate metrics names
updateDescriptionUpdate metrics descriptions
updateUrlsUpdate the URLs for a click or page view metric
updateSelectorUpdate the CSS selector for a click metric
updateOptimizelyMetricsUpdate Optimizely metrics

Feature flags actions

flag is a child of both a project and environments. A code sample is below:

1proj/*:env/*:flag/*

To learn more, read Creating a feature flag.

ActionDescription
createFlagCreate a feature flag. Creating a feature flag impacts all environments in a project, so users will need permission to create flags in all environments.
cloneFlagCreate a new flag with settings based on an existing flag. To clone a flag, you need to have the cloneFlag permission on the source flag, as well as the createFlag permission for the new flag
deleteFlagDelete a feature. Deleting a feature impacts all environments in a project, so users will need permission to delete features in all environments.
updateOnToggle a feature off
updateIncludeInSnippetChange whether the feature flag is available to front-end code with the JavaScript SDK. Impacts all environments in a project.
updateNameChange the name of a feature flag. Impacts all environments in a project.
updateDescriptionChange the description of a feature flag. Impacts all environments in a project.
updateTemporaryMarks a flag temporary or permanent. Impacts all environments in a project.
updateTagsUpdate tags associated with a flag. Impacts all environments in a project.
updatePrerequisitesUpdate flag prerequisites.
updateTargetsUpdate individual user targeting.
updateRulesUpdate custom targeting rules.
updateFallthroughUpdate the "default" or "fallthrough" rule.
updateOffVariationUpdate the variation returned when flag toggle is set to `off`.
updateMaintainerUpdate the flag maintainer. Impacts all environments.
updateFlagVariationsChange the flag's variations. Impacts all environments.
updateAttachedMetricsUpdate metrics connected to a flag (start or pause an experiment).
updateFlagCustomPropertiesUpdate custom properties attached to a flag. Impacts all environments.
updateVariationsUpdate percentage rollout variations
updateFlagDefaultVariationsChange the default flag variations new environments.

Segments actions

segment is a child of both a project and environments. A code sample is below:

1proj/*:env/*:segment/*

To learn more, read Building user segments.

Webhooks actions

webhook is a top-level resource. A code sample is below:

1webhook/*

To learn more, read Webhooks.

Integrations actions

Most third-party integrations use a shared set of custom role actions.

integration is a top-level resource. A code sample is below:

1integration/*

Destinations actions

destination is a child of both a project and environments.

1proj/*:env/*:destination/*

To learn more, read Data Export.

Code references actions

code-reference-repository is a top-level resource. A code sample is below:

1code-reference-repository/*

To learn more, read Git code references.

Optimizely API Tokens

For customers with A/B testing, a special resource integration/optimizely in conjunction with the action updateIntegration can be used to control access to updating their Optimizely API Token.

Users actions

user is a child of both a project and environments. A code sample is below:

1proj/*:env/*:user/*

To learn more, read The user dashboard.