mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-14 02:58:40 +00:00
normalize permission
This commit is contained in:
parent
721bb4d927
commit
254a71ffb7
|
|
@ -266,6 +266,8 @@ class Account implements ArrayableInterface, \JsonSerializable
|
|||
*/
|
||||
public function hasPermission(int $permission, int $unit = null, string $app = null, int $module = null, int $type = null, $element = null, $component = null) : bool
|
||||
{
|
||||
$app = isset($app) ? strtolower($app) : $app;
|
||||
|
||||
foreach($this->permissions as $p) {
|
||||
if(($p->getUnit() === $unit || $p->getUnit() === null)
|
||||
&& ($p->getApp() === $app || $p->getApp() === null)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user