Running this action requires a token — a base64(admin:password) string used for HTTP Basic authentication in requests to Nexus.

CreateNexusPrivilege — creates a new privilege in Nexus Repository Manager 3. Privileges define access rights to repositories and other Nexus resources.

Request example (repository-view)

name: example-privilege
description: Example privilege description
type: repository-view
actions:
  - READ
  - BROWSE
format: maven2
repository: maven-releases

Request example (repository-content-selector)

name: content-selector-privilege
description: Privilege with content selector
type: repository-content-selector
actions:
  - READ
format: maven2
repository: maven-releases
contentSelector: my-content-selector

Request example (wildcard)

name: wildcard-privilege
description: Wildcard privilege
type: wildcard
pattern: nx-*
actions:
  - READ

Request specification

FieldRequiredDescription
nameYesName of the privilege to create. Must be unique within Nexus
descriptionNoPrivilege description
typeYesPrivilege type: repository-view, repository-content-selector, repository-admin, application, wildcard
actionsNoList of actions allowed by the privilege (e.g., READ, BROWSE, CREATE, UPDATE, DELETE)
formatNoRepository format (e.g., maven2, docker, npm). Used for the repository-view, repository-content-selector, repository-admin types
repositoryNoRepository name. Used for the repository-view, repository-content-selector, repository-admin types
contentSelectorNoContent selector name. Required for the repository-content-selector type. If not specified or invalid, the type is automatically converted to repository-view
patternNoPattern for the wildcard type
domainNoDomain for the application type
attributesNoAdditional key-value parameters

Note

For the repository-content-selector type, the content selector must exist in Nexus before the privilege is created. If the content selector is not specified or is invalid, the action automatically converts the privilege type to repository-view.