Create Permission

JFrog REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Creates a new permission target in the system.

Security: Requires an admin user.

Since: Artifactory 7.72.0

Usage: POST <JFrog Base URL>/access/api/v2/permissions

Sample Request JSON

{
    "name": "Perm",
    "resources": {
        "artifact": {
            "actions": {
                "users": {},
                "groups": {}
            },
            "targets": {
                "example-repo-local": {
                    "include_patterns": [
                        "**",
                        "rep"
                    ],
                    "exclude_patterns": []
                },
                "ANY LOCAL": {
                    "include_patterns": [
                        "**",
                        "rep"
                    ],
                    "exclude_patterns": []
                }
        },
        "release_bundle": {
            "actions": {
                "users": {},
                "groups": {}
            },
            "targets": {
                "release-bundles-v2": {
                    "include_patterns": [
                        "**"
                    ],
                    "exclude_patterns": []
                },
                "release-bundles": {
                    "include_patterns": [
                        "**"
                    ],
                    "exclude_patterns": []
                }
            }
        },
        "build": {
            "actions": {
                "users": {},
                "groups": {}
            },
            "targets": {
                "artifactory-build-info": {
                    "include_patterns": [
                        "**",
                        "beta"
                    ],
                    "exclude_patterns": []
                }
            }
        }
    }
}

Sample Response:

{
  "name": "<permission-name>",
  "<resource-type>": {
    "targets": {
      "<target>": {
        "include_patterns": ["<ant-pattern>", ...],
        "exclude_patterns": ["<ant-pattern>", ...]
      },
      ...
    },
    "actions": {
      "users": {
        "<username>": ["<action>", ...],
        ...
      },
      "groups": {
        "<group-name>": ["<action>", ...],
        ...
      }
    }
  },
  ...
}