cPanel API MysqlFE::setdbuserprivileges
Hi,
I new to working with the API but I setup a few functions that are all working correctly with the with the xmlapi. I can't seem to get MysqlFE::setdbuserprivileges to work. I couldn't find documentation on what to set for 'privs'. The best I found was some references from v1. It gives me a success message no matter what I put in for 'privs' but all it will do is clear out the privileges that are there.
Should this code be working or are there other settings for 'privs' available? Thanks,
$xmlapi->api2_query($this->user, "MysqlFE", "setdbuserprivileges",array('privs'=>"all",'db'=>$dbname,'dbuser'=>$user));Should this code be working or are there other settings for 'privs' available? Thanks,
-
Hello :) This function is documented here: MysqlFE::setdbuserprivileges You can enable the API Shell option in cPanel to help formulate the API function call interactively: API Shell for cPanel Thank you. 0 -
Hi, Can you tell me how the 'privs' field is supposed to be constructed? It's not detailed there. I tried multiple different ways (example: 'ALTER','alter','all','ALL PRIVILEGES') with no success. It will clear out the privileges that are there so I'm assuming I got the call right. Thanks, 0 -
I'm in the same situation. I found this [url=http://docs.cpanel.net/twiki/bin/view/ApiDocs/Api1/ApiMysql#Mysql::adduserdb]Mysql Module Documentation in the API v1 which describe what the parameter "perms_list" should have. I have tried the same values for the API v2 0 -
Have any of you guys found a solution. It simply says it's a string but no example of how to construct it!! I have tried similar to you guys but not found a solution? 0 -
No, I never did find a solution. It's kind of sad too because I know the function works (because it clears out privileges you have set before) but there's no documentation on what parameters to send. 0 -
Stupid ain't it. Yeah it does something as it assigns the user ot the database, just sets no privileges! 0 -
[quote="rigiddesign, post: 1749262">Stupid ain't it. Yeah it does something as it assigns the user ot the database, just sets no privileges!
Let me know if this is helpful, after a quick glance at the code this is what it appears to map against. my %_api1_privilege_mappings = ( 'ALL PRIVILEGES' => 'all', 'CREATE ROUTINE' => 'routine', 'CREATE TEMPORARY TABLES' => 'temporary', 'CREATE VIEW' => 'createview', 'LOCK TABLES' => 'lock', 'SHOW VIEW' => 'showview', ); Edit: Also, try 'privileges' instead of 'privs'. Just a hunch(my $privs = $OPTS{'privileges'}) but I think we might have gotten documentation a little mixed up.0 -
Hi there! Yes, it's an error in the documentation. The parameter should be privileges instead of privs. I've gone ahead and corrected it. My apologies for the error and any problems that it has caused. Thank you for letting us know there was something amiss. If you notice any other issues in the documentation, please let us know through the documentation feedback at the bottom of the page, or file a case through one of our Support agents. Thanks, -ls Laurence Simon Technical Writer cPanel, Inc. 0 -
Sorry I'm a bit late getting back on this, but thanks for following up and researching that. It makes sense now because I was pretty much brute forcing the privs param with no result. Thanks, 0
Please sign in to leave a comment.
Comments
9 comments