* Finish task#8387.

This commit is contained in:
hufangzhou
2020-11-18 09:09:16 +08:00
parent b611a6fdf0
commit 55df1f202b
+4 -3
View File
@@ -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;