Child pages
  • UAPI Functions - WebDisk::set_permissions

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt
This function changes the Web Disk home directory's permissions.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledWebDiskRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titlecPanel or Webmail Session URL


Code Block
languagetext
https://hostname.example.com:2083/cpsess##########/execute/WebDisk/set_permissions?user=example1%40example.com&perms=rw

Include Page
LIB:_CallUAPIFromBrowserLink
LIB:_CallUAPIFromBrowserLink


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Set the home directory permissions for the example1 Web Disk user.
$new_permissions = $cpanel->uapi(
    'WebDisk', 'set_permissions',
    array(
        'user' 	   	=> 'example1@example.com',
		'perms'	=> 'rw",
         )
);

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

 


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Set the home directory permissions for the example1 Web Disk user.
my $set_permissions = $cpliveapi->uapi(
    'WebDisk', 'set_permissions',
    {
        'user'  	=>	'example1@example.com',
		'perms'	=>	'rw',
    }
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 


Expand
titlecPanel Template Toolkit


Code Block
languagexml
linenumberstrue
<!-- Set the home directory permissions for the example1 Web Disk user. -->
[% execute( 'WebDisk', 'set_permissions', { user => 'example1@example.com', perms => 'rw' } ); %]

Include Page
LIB:_TTLink
LIB:_TTLink

 


Expand
titleCommand Line


Code Block
uapi --user=username WebDisk set_permissions user=example1%40example.com perms=rw

Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{  
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{  

   },
   "data":null
}


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The Web Disk account's username.

The username of a Web Disk account on the cPanel account.

example1@example.com
permsstring

Required

The Web Disk account's home directory file permissions.

  • ro — Read-only permissions.
  • rw — Read and write permissions.
rw

Returns

This function only returns metadata.