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

View Privileges — myprivs

This function will generate a list of features you are allowed to use in WHM. Each feature will display either a 1 or 0. You are only able to use features with a corresponding 1.

Calling Functions

Using the XML API

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

  • Append the /xml-api/myprivs 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/myprivs

  • 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 myprivs function from within your custom script:

  • Append the /json-api/myprivs 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/myprivs

  • 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

Input

None

Output

For all variables listed below, except myprivs and privs:

  • 1 means the feature is enabled.
  • 0 means the feature is disabled.

The myprivs function call produces the following output variables:

  • myprivs — Root-level XML tag for the output of the myprivs function.
    • privs — Container for the list of privileges associated with your account.
      • add-pkg (boolean) — Allows the user to create packages.
      • add-pkg-ip (boolean) — Allows the user to create packages with dedicated IP addresses.
      • add-pkg-shell (boolean) — Allows the user to create packages with shell access.
      • all (boolean) — Provides all access privileges to the user.
        ALERT! Warning: If this feature is set to 1, the user has root access.
      • allow-addoncreate (boolean) — Allows the user to create packages with addon domains.
      • allow-parkedcreate (boolean) — Allows the user to create packages with addon domains.
      • allow-unlimited-bw-pkgs (boolean) — Allows the user to create packages with unlimited bandwidth.
      • allow-unlimited-disk-pkgs (boolean) — Allows the user to create packages with unlimited disk space quotas.
      • allow-unlimited-pkgs (boolean) — Allows the user to create packages with unlimited values for features (for example, unlimited email accounts).
      • clustering (boolean) — Allows the user to configure DNS clustering among multiple machines.
      • create-acct (boolean) — Allows the user to create accounts.
      • create-dns (boolean) — Allows the user to create DNS zones.
      • demo (boolean) — This feature is deprecated.
      • demo-setup (boolean) — Allows the user to enable demo mode on his or her accounts.
      • disallow-shell (boolean) — Prevents the user from creating packages with shell access.
      • edit-account (boolean) — Allows the user to modify accounts.
        ALERT! Warning: This will allow circumvention of account creation limits, give shell access unless explicitly disallowed, and provide access to dedicated IPs, among other features.
      • edit-dns (boolean) — Allows the user to edit DNS zones.
      • edit-mx (boolean) — Allows the user to edit MX entries.
      • edit-pkg (boolean) — Allows the user to create and delete packages.
      • frontpage (boolean) — Allows the user to manage FrontPage extensions for his or her domains.
      • kill-act (boolean) — Allows the user to delete his or her customers' accounts.
      • kill-dns (boolean) — Allows the user to delete DNS zones.
      • limit-bandwidth (boolean) — Allows the user to modify bandwidth limits on his or her accounts.
        ALERT! Warning: This will allow circumvention of account package limits, if you are not using resource limits.
      • list-accts (boolean) — Allows the user to list accounts owned by him or her.
      • mailcheck (boolean) — Allows the user to access the Mail Troubleshooter tool in WHM.
      • news (boolean) — Allows the user to send news messages to his or her customers' accounts.
      • park-dns (boolean) — Allows the user to park domains within WHM.
      • passwd (boolean) — Allows the user to modify passwords for his or her customers' accounts.
      • quota (boolean) — Allows the user to modify disk space quotas for his or her accounts.
        ALERT! Warning: This will allow circumvention of account package limits, if you are not using resource limits.
      • rearrange-accts (boolean) — Allows the user to rearrange the locations of customer accounts, in order to free up disk space.
      • res-cart (boolean) — Allows the user to reset shopping carts for their domain accounts.
      • resftp (boolean) — Allows the user to resync FTP account passwords.
      • restart (boolean) — Allows the user to restart services on the server (Apache, Exim, etc).
      • show-bandwidth (boolean) — Allows the user to view the bandwidth usage of his or her customers' accounts.
      • ssl (boolean) — Allows the user to manage the SSL certificates installed on his or her domains.
      • ssl-buy (boolean) — Allows the user to use the Purchase and Install SSL Certificate feature in WHM.
      • ssl-gencrt (boolean) — Allows the user to use the SSL CSR/CRT generator.
      • stats (boolean) — Allows the user to view Server Information in WHM.
      • status (boolean) — Allows the user to view Service Status in WHM.
      • suspend-acct (boolean) — Allows the user to suspend his or her customers' accounts.
      • thirdparty (boolean) — Allows the user to manage third-party service offerings.
      • upgrade-account (boolean) — Allows the user to upgrade and downgrade his or her customers' domain accounts.
      • viewglobalpackages (boolean) — Allows the user to access any package on the server that is not specifically assigned to a user. (This applies to any package except those with an underscore ("_") in their names.)

Examples

XML API

Calling https://example.com:2087/xml-api/myprivs in WebHost Manager will produce output similar to:

<myprivs>
     <privs>
        <add-pkg>1</add-pkg>
        <add-pkg-ip>1</add-pkg-ip>
        <add-pkg-shell>0</add-pkg-shell>
        <all>1</all>
        <allow-addoncreate>0</allow-addoncreate>
        <allow-parkedcreate>0</allow-parkedcreate>
        <allow-unlimited-bw-pkgs>1</allow-unlimited-bw-pkgs>
        <allow-unlimited-disk-pkgs>1</allow-unlimited-disk-pkgs>
        <allow-unlimited-pkgs>0</allow-unlimited-pkgs>
        <clustering>1</clustering>
        <create-acct>1</create-acct>
        <create-dns>1</create-dns>
        <demo>0</demo>
        <demo-setup>0</demo-setup>
        <disallow-shell>0</disallow-shell>
        <edit-account>1</edit-account>
        <edit-dns>1</edit-dns>
        <edit-mx>1</edit-mx>
        <edit-pkg>1</edit-pkg>
        <frontpage>1</frontpage>
        <kill-acct>1</kill-acct>
        <kill-dns>1</kill-dns>
        <limit-bandwidth>1</limit-bandwidth>
        <list-accts>1</list-accts>
        <mailcheck>1</mailcheck>
        <news>1</news>
        <park-dns>1</park-dns>
        <passwd>1</passwd>
        <quota>0</quota>
        <rearrange-accts>0</rearrange-accts>
        <res-cart>1</res-cart>
        <resftp>0</resftp>
        <restart>0</restart>
        <show-bandwidth>1</show-bandwidth>
        <ssl>1</ssl>
        <ssl-buy>1</ssl-buy>
        <ssl-gencrt>1</ssl-gencrt>
        <stats>1</stats>
        <status>0</status>
        <suspend-acct>1</suspend-acct>
        <thirdparty>1</thirdparty>
        <upgrade-account>1</upgrade-account>
        <viewglobalpackages>1</viewglobalpackages>
   </privs>
</myprivs>

JSON API

Calling https://example.com:2087/json-api/myprivs in WebHost Manager will produce output similar to:

{
   "privs":{
      "kill-dns":0,
      "edit-dns":0,
      "edit-mx":0,
      "add-pkg":0,
      "status":0,
      "suspend-acct":0,
      "add-pkg-shell":0,
      "viewglobalpackages":0,
      "resftp":0,
      "list-accts":0,
      "all":1,
      "passwd":0,
      "quota":0,
      "park-dns":0,
      "rearrange-accts":0,
      "allow-addoncreate":0,
      "demo":0,
      "news":0,
      "edit-account":0,
      "allow-unlimited-disk-pkgs":0,
      "allow-parkedcreate":0,
      "frontpage":0,
      "restart":0,
      "ssl-gencrt":0,
      "allow-unlimited-pkgs":0,
      "add-pkg-ip":0,
      "res-cart":0,
      "disallow-shell":0,
      "ssl-buy":0,
      "kill-acct":0,
      "allow-unlimited-bw-pkgs":0,
      "create-dns":0,
      "mailcheck":0,
      "clustering":0,
      "ssl":0,
      "edit-pkg":0,
      "show-bandwidth":0,
      "upgrade-account":0,
      "thirdparty":0,
      "limit-bandwidth":0,
      "create-acct":0,
      "demo-setup":0,
      "stats":0
   }
}

Topic revision: r7 - 29 Sep 2009 - 17:41:13 - MelanieSeibert