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: The input variables listed below take the following values:
  • To enable the variable, set it to 1.
  • To disable the variable, do not include it in the URL.

  • acl-add-pkg (boolean) — Allow the creation of packages.
  • acl-add-pkg-ip (boolean) — Allow the creation of packages with dedicated IPs.
  • acl-add-pkg-shell (boolean) — Allow the creation of packages with shell access
  • acl-all (boolean) — All features. All features.
    ALERT! Warning: Enabling this feature grants the user root access!
  • acl-allow-addoncreate (boolean) — Allow the creation of packages with unlimited addon domains.
  • acl-allow-parkedcreate (boolean) — Allow the creation of packages with parked domains.
  • acl-allow-unlimited-disk-pkgs (boolean) — Allow the creation of packages with unlimited disk space.
  • acl-allow-unlimited-pkgs (boolean) — Allow the creation of packages with unlimited bandwidth.
  • acl-clustering (boolean) — Enable clustering.
  • acl-create-acct (boolean) — Allow the creation of new accounts.
  • acl-create-dns (boolean) — Enable the reseller to add DNS zones.
  • acl-demo-setup (boolean) — Turn an account into a demo account.
  • acl-disallow-shell (boolean) — Never allow creation of accounts with SSH access.
  • acl-edit-account (boolean) — Allow the reseller to modify an account.
  • acl-edit-dns (boolean) — Allow the reseller to edit DNS zones.
  • acl-edit-mx (boolean) — Allow the reseller to edit MX entries.
  • acl-frontpage (boolean) — Allow the reseller to install and uninstall FrontPage extensions.
  • acl-kill-acct (boolean) — Allow the reseller to terminate an account.
  • acl-kill-dns (boolean) — Allow the reseller to remove a DNS entry.
  • acl-limit-bandwidth (boolean) — Allow the reseller to modify bandwidth limits.
    ALERT! Warning: This will allow the reseller to circumvent package bandwidth limits if you are not using resource limits!
  • acl-list-accts (boolean) — Allow the reseller to list accounts.
  • acl-mailcheck (boolean) — Allow the reseller to access the WHM Mail Troubleshooter.
  • acl-mod-subdomains (boolean) — Allow the reseller to enable and disable subdomains.
  • acl-news (boolean) — Allow the reseller to modify the cPanel/WHM news.
  • acl-onlyselfandglobalpkgs (boolean) — Prevent the creation of accounts with packages that are neither global nor owned by this user.
  • acl-park-dns (boolean) — Allow the reseller to park domains.
  • acl-passwd (boolean) — Allow the reseller to modify passwords.
  • 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-rearrange-accts (boolean) — Allow the reseller to rearrange accounts.
  • acl-res-cart (boolean) — Allow the reseller to reset the shopping cart.
  • acl-resftp (boolean) — Allow the reseller to synchronize FTP passwords.
  • acl-restart (boolean) — Allow the reseller to restart services.
  • acl-show-bandwidth (boolean) — Allow the reseller to view account bandwidth usage.
  • acl-ssl (boolean) — Allow the reseller to access the SSL Manager.
  • acl-ssl-buy (boolean) — Allow the reseller to purchase and install SSL certificates.
  • acl-ssl-gencrt (boolean) — Allow the reseller to access the SSL CSR/CRT generator.
  • acl-stats (boolean) — Allow the reseller to view account statistics.
  • acl-status (boolean) — Allow the reseller to view the Service Status feature in WHM.
  • acl-suspend-accts (boolean) — Allow the reseller to suspend accounts.
  • acl-upgrade-account (boolean) — Allow the reseller to upgrade and downgrade accounts.

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/sectacls?reseller=andy in WebHost Manager will disable all ACL options for the reseller "andy".
  • Calling xml-api/sectacls?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/sectacls?reseller=andy in WebHost Manager will disable all ACL options for the reseller "andy".
  • Calling json-api/sectacls?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: r6 - 29 Sep 2009 - 18:05:07 - Main.MelanieSeibert
 

Copyright © cPanel 2000-2010.