Organizations

Get organization's authorization policy

Get organization's authorization policy

get/orgs/{orgName}/authorization-policy

Request

Path parameters

orgNamestring required
Example:org1

Organization name

Response

authorization_enabledboolean required
predefined_policystring
custom_policystring
policy_datastring

Example response

{
  "predefined_policy": "rbac.v1",
  "custom_policy": "package artifacthub.authz\n\n# By default, deny requests\ndefault allow = false\n\n# Allow the action if the user is allowed to perform it\nallow {\n  # If user's role is owner\n  data.roles.owner.users[_] == input.user\n}\nallow {\n  # If user's role is allowed to perform this action\n  allowed_actions[_] == input.action\n}\n\n# Get user allowed actions\nallowed_actions[action] {\n  user_roles[_] == \"owner\"\n  action := \"all\"\n}\nallowed_actions[action] {\n  action := data.roles[role].allowed_actions[_]\n  user_roles[_] == role\n}\n\n# Get user roles\nuser_roles[role] {\n  data.roles[role].users[_] == input.user\n}\n",
  "policy_data": "{\n  \"roles\": {\n    \"owner\": {\n      \"users\": [\"user1\"]\n    },\n    \"customRole1\": {\n      \"users\": [\"member1\", \"member2\"],\n      \"allowed_actions\": [\"addOrganizationMember\", \"addOrganizationRepository\"]\n    }\n  }\n}\n"
}

Changes

No recorded changes to this operation across all 3 revisions of this API.