PrivilegeManagement

This type represents the Privilege Management Service that exposes common operations on privileges.

GraphViz

Schema

The considered APS type (download) extends the Resource APS type(s) and looks as follows:

{
  "name": "PrivilegeManagement",
  "id": "http://www.parallels.com/pa/pa-core-services/privilege-management/1.0",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/resource/1.0"
  ],
  "access": {
    "global": true
  },
  "operations": {
    "registerPrivileges": {
      "path": "privileges",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "privileges": {
          "kind": "body",
          "type": "array"
        }
      }
    },
    "unregisterPrivileges": {
      "path": "privileges",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "privileges": {
          "kind": "body",
          "type": "array"
        }
      }
    }
  },
  "structures": {
    "Privilege": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "Privilege title",
          "required": true
        },
        "allowLocked": {
          "type": "boolean",
          "default": "false"
        },
        "area": {
          "type": "string",
          "description": "Privilege scope",
          "default": "clients",
          "enum": [
            "provider",
            "resellers",
            "clients"
          ]
        },
        "name": {
          "type": "string",
          "description": "Privilege value",
          "required": true
        }
      }
    }
  }
}

The APS type is used to create a singleton APS resource exposing its operations for API calls. The call syntax depends on the operation. For example, a call of an operation that accepts input parameters both in the URL string and in the body looks as follows:

POST  /aps/2/services/privilege-manager/<operation-path>?<query-params>

{/*<body params>*/}

In the above call, the verb can be either GET, PUT, POST, or DELETE as specified in the definition of the operation.

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

registerPrivileges

POST

/privileges

If successful, this method returns the 200 OK standard status code.

Register a list of privileges.

unregisterPrivileges

DELETE

/privileges

If successful, this method returns the 200 OK standard status code.

Unregister a list of privileges.

registerPrivileges

HTTP Request

POST /aps/2/services/privilege-manager/privileges

Description

Register a list of privileges.

Parameters

PARAMETER

TYPE

DESCRIPTION

privileges

Array

List of privileges Privilege to register.

Returns

If successful, this method returns the 200 OK standard status code.

unregisterPrivileges

HTTP Request

DELETE /aps/2/services/privilege-manager/privileges

Description

Unregister a list of privileges.

Parameters

PARAMETER

TYPE

DESCRIPTION

privileges

Array

List of privileges Privilege to unregister.

Returns

If successful, this method returns the 200 OK standard status code.

Structures

Privilege

Privilege structure.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

title

String

Required

The title of the structure.

allowLocked

Boolean

Not Required

false

Allow the password lock mechanism.

area

Enum

Not Required

clients

The type of accounts affected by the privilege:
“provider” - affects the provider’s users.
“resellers” - affects the users of the resellers.
“clients” - affects the users of the customers.

name

String

Required

The name of the structure.

Examples

Since the considered APS type contains custom operations, refer to Custom Operations for the general explanation of their structure and examples of operation calls.