public function hasPermission($recipient, $permission)
    {

        if ($recipient instanceof Group) {
            $check = true;
            foreach ($recipient->getLogins() as $login) {
                if ($this->hasLoginPermission($login, $permission) === false) {
                    $check = false;
                }
            }

            return $check;
        } else {
            return $this->hasLoginPermission($recipient, $permission);
        }
    }
public function hasPermission($recipient, $permission)
    {

        if ($recipient instanceof Group) {
            $check = true;
            foreach ($recipient->getLogins() as $login) {
                if ($this->hasLoginPermission($login, $permission) === false) {
                    $check = false;
                }
            }

            return $check;
        } else {
            return $this->hasLoginPermission($recipient, $permission);
        }
    }
public function hasPermission ( $ recipient , $ permission ) { if ( $ recipient instanceof Group ) { $ check = true ; foreach ( $ recipient -> getLogins ( ) as $ login ) { if ( $ this -> hasLoginPermission ( $ login , $ permission ) === false ) { $ check = false ; } } return $ check ; } else { return $ this -> hasLoginPermission ( $ recipient , $ permission ) ; } }
Checks if group, a login or a player has a certain permission or not.

@param string|Group|Player $recipient
@param string              $permission The permission to check for.

@return bool
Checks if group a login or a player has a certain permission or not .