Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation

Set a Reseller's ACL List — setacls

This function specifies the ACL for a reseller, or modifies specific ACL items for a reseller. (ACL lists can be found in the WHM interface on the Edit Privileges/Nameservers screen).

Calling Functions

Using the XML API

To use the XML API to perform the setacls function from within your custom script:

  • Append the /xml-api/setacls function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/xml-api/setacls

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Using the JSON API

To use the JSON API to perform the setacls function from within your custom script:

  • Append the /json-api/setacls function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/json-api/setacls

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Variables

note Note: Calling this API function without defining an ACL option will disable that ACL option; see the examples for more details.

Input

The setacls function takes the following variables as input.

Required variable

  • reseller (string) — The username of the reseller whose ACL list you wish to change.

Optional variables

  • acllist (string) — Name of the ACL list.
    note Note: This cannot be used with specific acl-x-x variables (below). You must either use an ACL list or a set of specific variables.

PICK Important: For each variable below:
  • To enable the variable, set it to 1.
  • To disable the variable, do not include it in the function call.

  • Packages
    • acl-edit-pkg (boolean) — Allow the reseller to edit packages.
    • acl-add-pkg (boolean) — Allow the reseller to create packages.
  • Troubleshooting
  • Account Information
    • acl-show-bandwidth (boolean) — Allow the reseller to view account bandwidth usage.
    • acl-list-accts (boolean) — Allow the reseller to use the List Accounts feature.
  • Clustering
    • acl-clustering (boolean) — Enable DNS clustering for the reseller.
  • cPanel Management
    • acl-news (boolean) — Allow the reseller to modify the cPanel & WHM news.
  • Third Party Services
    • acl-thirdparty (boolean) — Allow the reseller to manage third-party services.
  • Dns
    • acl-kill-dns (boolean) — Allow the reseller to remove DNS records.
    • acl-edit-dns (boolean) — Allow the reseller to edit DNS records.
    • acl-park-dns (boolean) — Allow the reseller to park domains.
    • acl-create-dns (boolean) — Allow the reseller to add DNS entries.
  • Account Management
    • acl-ssl (boolean) — Allow the reseller to access the SSL Manager.
    • acl-create-acct (boolean) — Allow the reseller to create accounts.
    • acl-suspend-acct (boolean) — Allow the reseller to suspend and un-suspend accounts.
    • acl-res-cart (boolean) — Allow the reseller to reset users' shopping carts.
    • acl-passwd (boolean) — Allow the reseller to change cPanel users' passwords.
    • acl-ssl-buy (boolean) — Allow the reseller to purchase and install SSL certificates.
    • acl-frontpage (boolean) — Allow the reseller to install and uninstall FrontPage extensions.
    • acl-upgrade-account (boolean) — Allow the reseller to upgrade and downgrade accounts.
    • acl-ssl-gencrt (boolean) — Allow the reseller to access the SSL CSR/CRT generator.
    • acl-edit-mx (boolean) — Allow the reseller to edit MX entries.
    • acl-kill-acct (boolean) — Allow the reseller to terminate cPanel accounts.
  • Package Access
    • acl-viewglobalpackages (boolean) — Allow the reseller to use all global packages (global packages are any packages without a "_" in them)
  • Accounts
    • acl-disallow-shell (boolean) — Prevent accounts from being created with shell access.
  • Packages Creation
    • acl-add-pkg-shell (boolean) — Allow Creation of Packages with Shell Access.
    • acl-allow-addoncreate (boolean) — Allow Creation of Packages with Addon Domains.
    • acl-allow-parkedcreate (boolean) — Allow Creation of Packages with Parked Domains.
    • acl-allow-unlimited-disk-pkgs (boolean) — Allow Creation of Packages with Unlimited Diskspace.
    • acl-allow-unlimited-pkgs (boolean) — Allow Creation of Packages with Unlimited Features (ie, unlimited POP accounts).
    • acl-allow-unlimited-bw-pkgs (boolean) — Allow Creation of Packages with Unlimited Bandwidth.
    • acl-add-pkg-ip (boolean) — Allow Creation of Packages with a Dedicated IP.
  • Troubleshooting
    • acl-resftp (boolean) — Allow the reseller to synchronize FTP passwords.
  • Locales
    • acl-locale-edit (boolean) — Allow the reseller to modify existing locales and create new locales.
  • Services
    • acl-restart (boolean) — Allow the reseller to restart system services.
  • Server Information
    • acl-status (boolean) — Allow the reseller to view the Service Status feature in WHM.
    • acl-stats (boolean) — Allow the reseller to view account statistics.
  • Account Management
    • acl-quota (boolean) — Allow the reseller to modify disk quotas.
      • ALERT! Warning: This will allow resellers to circumvent package limits for disk space, if you are not using resource limits.
    • acl-demo-setup (boolean) — Allow the reseller to turn a cPanel account into a demo account.
    • acl-edit-account (boolean) — Allow the reseller to modify an account.
      • ALERT! Warning: This allows the reseller to circumvent account creation limits, give shell access unless it is explicitly disallowed, and manage dedicated IP addresses.
    • acl-limit-bandwidth (boolean) — Allow the reseller to modify bandwidth limits.
      • ALERT! Warning: This will allow the reseller to circumvent account package limits if you are not using resource limits.
  • Advanced Account Management
    • acl-rearrange-accts (boolean) — Allow the reseller to rearrange accounts in order to free up disk space.
  • Everything
    • acl-all (boolean) — Allows the reseller access to all features, including the root access.

Output

  • setacls — Root-level XML tag for the output of the setacls function.
    • result — Container for the results of the setacls operation.
      • acls (string) — Name of an ACL that has been set.
      • status (boolean) — Whether or not the ACL changes were saved.
        • 1 — yes.
        • 0 — no.
      • statusmsg (string) — Status or error message about the results of the function.

Examples

XML API

Enabling and disabling ACL options

note Note: If you do not explicitly enable an option when specifying ACL options, it will be disabled — even if you do not include that option in the URL string. For example:

  • Calling xml-api/setacls?reseller=andy in WebHost Manager will disable all ACL options for the reseller "andy".
  • Calling xml-api/setacls?reseller=andy&acl-create-acct=1 in WebHost Manager will enable only the account creation ACL option for the reseller "andy".

Using an ACL list

Calling the URL =https://example.com:2087/xml-api/setacls?reseller=bob&acllist=bob* in WebHost Manager will produce output similar to:

<setacls>
      <result>
            <acls>suspend-acct</acls>
             <acls>viewglobalpackages</acls>
             <acls>resftp</acls>
             <acls>list-accts</acls>
             <acls>quota</acls>
             <acls>passwd</acls>
             <acls>ssl</acls>
             <status>1</status>
             <statusmsg>Reseller Acls Saved</statusmsg>
      </result>
</setacls>

Updating specific ACL items

Calling the URL https://example.com:2087/xml-api/setacls?reseller=bob&acl-all=1&acl-ssl=1 in WebHost Manager will produce output similar to:

<setacls>
     <result>
            <acls>ssl</acls>
            <acls>all</acls>
            <status>1</status>
            <statusmsg>Reseller Acls Saved</statusmsg>
      </result>
</setacls>

JSON API

Enabling and disabling ACL options

note Note: If you do not explicitly enable an option when specifying ACL options, it will be disabled — even if you do not include that option in the URL string. For example:

  • Calling json-api/setacls?reseller=andy in WebHost Manager will disable all ACL options for the reseller "andy".
  • Calling json-api/setacls?reseller=andy&acl-create-acct=1 in WebHost Manager will enable only the account creation ACL option for the reseller "andy".

Using an ACL list

Calling the URL =https://example.com:2087/json-api/setacls?reseller=bob&acllist=bob* in WebHost Manager will produce output similar to:

{
   "result":[
      {
         "status":1,
         "statusmsg":"Reseller Acls Saved",
         "acls":[
            "kill-dns",
            "edit-dns",
            "edit-mx",
            "add-pkg",
            "suspend-acct",
            "ssl",
         ]
      }
   ]
}

Updating specific ACL items

Calling the URL https://example.com:2087/json-api/setacls?reseller=bob&acl-all=1&acl-ssl=1 in WebHost Manager will produce output similar to:

{
   "result":[
      {
         "status":1,
         "statusmsg":"Reseller Acls Saved",
         "acls":[
            "ssl",
            "all"
         ]
      }
   ]
}

Topic revision: r10 - 08 Nov 2011 - 15:20:13 - MelanieSeibert