* Finish task#8387.
This commit is contained in:
@@ -1487,18 +1487,19 @@ EOD;
|
||||
*/
|
||||
public static function hasPriv($module, $method, $object = null)
|
||||
{
|
||||
$module = strtolower($module);
|
||||
$method = strtolower($method);
|
||||
|
||||
global $app, $lang;
|
||||
|
||||
/* Check the parent object is closed. */
|
||||
if(strpos('close|batchClose', $method) === false and !commonModel::canBeChanged($module, $object)) return false;
|
||||
if(strpos('close|batchclose', $method) === false and !commonModel::canBeChanged($module, $object)) return false;
|
||||
|
||||
/* Check is the super admin or not. */
|
||||
if(!empty($app->user->admin) || strpos($app->company->admins, ",{$app->user->account},") !== false) return true;
|
||||
/* If not super admin, check the rights. */
|
||||
$rights = $app->user->rights['rights'];
|
||||
$acls = $app->user->rights['acls'];
|
||||
$module = strtolower($module);
|
||||
$method = strtolower($method);
|
||||
|
||||
if((($app->user->account != 'guest') or ($app->company->guest and $app->user->account == 'guest')) and $module == 'report' and $method == 'annualdata') return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user