original_string: public function hasPermission($permission)
      {
          $permission = !is_string($permission) ?: Permission::where(['slug' => $permission])->first();
  
          if ($permission) {
              foreach ($this->permissions as $p) {
                  if ($p->id == $permission->id) {
                      return true;
                  }
              }
          }
  
          return false;
      }
code: public function hasPermission($permission)
      {
          $permission = !is_string($permission) ?: Permission::where(['slug' => $permission])->first();
  
          if ($permission) {
              foreach ($this->permissions as $p) {
                  if ($p->id == $permission->id) {
                      return true;
                  }
              }
          }
  
          return false;
      }
code_tokens: public function hasPermission ( $ permission ) { $ permission = ! is_string ( $ permission ) ? : Permission :: where ( [ 'slug' => $ permission ] ) -> first ( ) ; if ( $ permission ) { foreach ( $ this -> permissions as $ p ) { if ( $ p -> id == $ permission -> id ) { return true ; } } } return false ; }
docstring: Returns if the user has a permission.
  
  @param mixed $permision
  
  @return bool
docstring_tokens: Returns if the user has a permission .