src/User/User.php
public function hasPermission($permission)
    {
        if ($this->isAdmin()) {
            return true;
        }

        if (is_null($this->permissions)) {
            $this->permissions = $this->getPermissions();
        }

        return in_array($permission, $this->permissions);
    }
public function hasPermission($permission)
    {
        if ($this->isAdmin()) {
            return true;
        }

        if (is_null($this->permissions)) {
            $this->permissions = $this->getPermissions();
        }

        return in_array($permission, $this->permissions);
    }
public function hasPermission ( $ permission ) { if ( $ this -> isAdmin ( ) ) { return true ; } if ( is_null ( $ this -> permissions ) ) { $ this -> permissions = $ this -> getPermissions ( ) ; } return in_array ( $ permission , $ this -> permissions ) ; }
Check whether the user has a certain permission based on their groups.

@param string $permission
@return bool
Check whether the user has a certain permission based on their groups .