Skip to main content

cPanel API MysqlFE::setdbuserprivileges

Comments

9 comments

  • cPanelMichael
    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
  • mattpeters
    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
  • pguilbault
    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
  • rigiddesign
    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
  • mattpeters
    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
  • rigiddesign
    Stupid ain't it. Yeah it does something as it assigns the user ot the database, just sets no privileges!
    0
  • AndrewH.
    [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
  • cPLaurenceS
    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
  • mattpeters
    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.