src/Defender/Defender.php
public function roleHasPermission($permission, $force = false)
    {
        if (! is_null($this->getUser())) {
            return $this->getUser()->roleHasPermission($permission, $force);
        }

        return false;
    }
public function roleHasPermission($permission, $force = false)
    {
        if (! is_null($this->getUser())) {
            return $this->getUser()->roleHasPermission($permission, $force);
        }

        return false;
    }
public function roleHasPermission ( $ permission , $ force = false ) { if ( ! is_null ( $ this -> getUser ( ) ) ) { return $ this -> getUser ( ) -> roleHasPermission ( $ permission , $ force ) ; } return false ; }
Check if the authenticated user has the given permission
using only the roles.

@param string $permission
@param bool   $force

@return bool
Check if the authenticated user has the given permission using only the roles .