Child pages
  • cPanel API 1 Functions - Fileman::showperm
Skip to end of metadata
Go to start of metadata

Description

This function displays a file's permissions.

Warning:

cPanel API 1 is deprecated. We strongly recommend that you do not use cPanel API 1. However, no equivalent function exists in our newer APIs.

Important:

In cPanel & WHM version 76 and later, when you disable the FileStorage role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples


 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$view_permissions = $cpanel->api1('Fileman', 'showperm', array('public_html', 'myfile')); // Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $view_permissions = $cpliveapi->api1('Fileman', 'showperm' ['public_html', 'myfile']); # Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Tag System (deprecated)


Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="Fileman::showperm ( $FORM('dir','file'))">
 Command Line
cpapi1 --user=username Fileman showperm public_html myfile


Notes:

  • You must URI-encode these values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the cpapi1 command:

    /usr/local/cpanel/bin/cpapi1

 Output (HTML)
<tr>
 <td><b>Mode</b></td>
 <td>User</td><td>Group</td>
 <td>World</td>
 </tr>
 <tr>
 <td>Read</td>
 <td><input checked="checked" type="checkbox" name="ur" value="4" onClick="calcperm();"></td>
 <td><input checked="checked" type="checkbox" name="gr" value="4" onClick="calcperm();"></td>
 <td><input checked="checked" type="checkbox" name="wr" value="4" onClick="calcperm();"></td>
 </tr>
 <tr>
 <td>Write</td>
 <td><input checked="checked" type="checkbox" name="uw" value="2" onClick="calcperm();"></td>
 <td><input type="checkbox" name="gw" value="2" onClick="calcperm();"></td>
 <td><input type="checkbox" name="ww" value="2" onClick="calcperm();"></td>
 </tr>
 <tr>
 <td>Execute</td>
 <td><input type="checkbox" name="ux" value="1" onClick="calcperm();"></td>
 <td><input type="checkbox" name="gx" value="1" onClick="calcperm();"></td>
 <td><input type="checkbox" name="wx" value="1" onClick="calcperm();"></td>
 </tr>
 <tr>
 <td>Permission</td>
 <td><input type="text" name="u" size="1" readonly="readonly"></td>
 <td><input type="text" name="g" size="1" readonly="readonly"></td>
 <td><input type="text" name="w" size="1" readonly="readonly"></td>
 </tr>



Parameters

ParameterTypeDescriptionPossible valuesExample
dirstring

Required

The file's directory.

Any valid directory name.public_html
filestring

Required

The file.

Any valid filenamemyfile

Returns

This function returns HTML to display the file's permissions.