Retrieving Descriptor of Permissions

Use the get-permission-descriptor operation to retrieve permissions descriptors of add-on plans. For details on descriptor, refer to the Representation of Object Descriptors section. For details on permissions of service plans, refer to the Permissions section.

In this chapter:

Request Packet Structure

Response Packet Structure

Samples

 

Request Packet Structure

A request XML packet retrieving add-on plan limits includes the get-permission-descriptor operation node:

<packet>
<service-plan-addon>
   <get-permission-descriptor>
   ...
   </get-permission-descriptor>
</service-plan-addon>
</packet>

The get-permission-descriptor node is presented by type DomainAddonTemplateGetInputType (domain_addon_template.xsd). Its graphical representation is as follows:

addon-

Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.

  • The filter node is required. It specifies a criteria by which add-on plans will be selected. Data type: DomainAddonTemplateFilterType (domain_addon_template.xsd). See the Available Filters section for details on this node.
  • The owner-id node is optional. It specifies the ID of the add-on plan owner. Data type: integer.
  • The owner-login node is optional. It specifies the username of the add-on plan owner. Data type: string.
 

Response Packet Structure

Theget-permission-descriptor node of the output XML packet is of type DomainAddonTemplateDescriptorOutput (domain_addon_template.xsd) which is structured as follows:

addon-get-permission-desriptor-output

Note: The interactive schema navigator for all response packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_output.svg.

  • The result node is required. It wraps the result of the requested get-permission-descriptor operation. Data type: ResultFilterType (common.xsd).
  • The status node is required. It returns the execution status of the get-permission-descriptor operation. Data type: result_status (common.xsd). Allowed values: ok|error.
  • The errcode node is optional. Is used to return the error code when the get-permission-descriptor operation fails. Data type: unsignedInt.
  • The errtext node is optional. Can be used to return an error message if the get-permission-descriptor operation fails. Data type: string.
  • The id node is optional. It is required if the operation succeeds and the results are filtered by ID. It returns an ID of the add-on plan which permissions descriptor was displayed. Data type: id_type (common.xsd).
  • The name node is optional. It is required if the operation succeeds and the results are filtered by name. It returns a name of the add-on plan which permissions descriptor was displayed. Data type: string (common.xsd).
  • The guid node is optional. It is required if the operation succeeds and the results are filtered by GUID. It returns a GUID of the add-on plan which permissions descriptor was displayed. Data type: string (common.xsd).
  • The external-id node is optional. It is required if the operation succeeds and the results are filtered by external ID. It returns the external ID of the add-on plan which permissions descriptor was displayed. Data type: string (common.xsd).
  • The descriptor node is required if the get-permission-descriptor operation succeeds. It specifies object descriptor. For details, refer to the Representation of Object Descriptors section. Data type: string.

    Note: This descriptor contains permissions extensions. For details, refer to the Representation of Object Descriptors: Property Descriptor > Extension of Limits Descriptor section.

 

Samples

The following packet retrieves limits descriptor for a service plan:

<packet>
<service-plan-addon>
<get-permission-descriptor>
   <filter>
      <name>base_plan</name>
   </filter>
</get-permission-descriptor>
</service-plan-addon>
</packet>

Response:

<packet>
  <service-plan-addon>
    <get-permission-descriptor>
      <result>
        <status>ok</status>
        <name>1 Additional Gigabyte</name>
        <descriptor>
          <property>
            <name>create_domains</name>
            <type>boolean</type>
            <default-value>false</default-value>
            <writable-by>admin</writable-by>
            <writable-by>reseller</writable-by>
            <label>cl_perm__create_domains</label>
            <extension>
              <level>reseller</level>
            </extension>
          </property>
          <property>
            <name>manage_phosting</name>
            <type>boolean</type>
            <default-value>false</default-value>
            <writable-by>admin</writable-by>
            <writable-by>reseller</writable-by>
            <label>cl_perm__manage_phosting</label>
            <extension>
              <level>reseller</level>
              <level>domain</level>
            </extension>
          </property>
                   ...
          <bind>
            <ref>allow_insecure_sites</ref>
            <relevant>
              <name>manage_phosting</name>
              <value>true</value>
            </relevant>
            <read-only>0</read-only>
          </bind>
                   ...
        </descriptor>
      </result>
    </get-permission-descriptor>
  </service-plan-addon>
</packet>

Note: Data structures that describe a number of properties are omitted to improve the readability of the sample.

A single filter can specify multiple plans, all specified either by ID or by name.

<packet>
<service-plan-addon>
<get-permission-descriptor>
   <filter>
      <name>base_plan</name>
      <name>quick_plan</name>
   </filter>
</get-permission-descriptor>
</service-plan-addon>
</packet>
 

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.