Module permission question

Discussion in 'Developers' Forum' started by laptop_user, Oct 13, 2011.

  1. laptop_user

    laptop_user Member

    Hello,

    I have question with remote framework and module permission. Lets say I create a new page called User Details under Tools module.

    I use remote framework and I hard coded everything to the page. I was wondering how could I check user permission. Is the example below actually sufficient?

    Code:
    // check permission
    require_once('../../lib/config.inc.php');
    require_once('../../lib/app.inc.php');
    
    //* Check permissions for module
    $app->auth->check_module_permissions('tools');
    
    
    
    
    // start soap
    require('soap_config.php');
    
    $client = new SoapClient(null, array('location' => $soap_location,
                          doing remote thing here             ....

    I mean this thing is used for authentication?
    Code:
    require_once('../../lib/config.inc.php');
    require_once('../../lib/app.inc.php');
    
    //* Check permissions for module
    $app->auth->check_module_permissions('tools');
    Is it sufficient enough to check whether user is login or not and everything?

    Thanks in advance.
     
  2. till

    till Super Moderator

    Yes. This command cecks if the user is logged in and has permission to access the tools module. But thats not related to the remote api, these checks are ispconfig interface functions.
     

Share This Page