src/Defender/Traits/HasDefender.php
public function roleHasPermission($permission, $force = false)
    {
        $permissions = $this->getRolesPermissions($force)->pluck('name')->toArray();

        return in_array($permission, $permissions);
    }
public function roleHasPermission($permission, $force = false)
    {
        $permissions = $this->getRolesPermissions($force)->pluck('name')->toArray();

        return in_array($permission, $permissions);
    }
public function roleHasPermission ( $ permission , $ force = false ) { $ permissions = $ this -> getRolesPermissions ( $ force ) -> pluck ( 'name' ) -> toArray ( ) ; return in_array ( $ permission , $ permissions ) ; }
Check if the user has the given permission using
only his roles.

@param string $permission
@param bool   $force

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