code: def share_file_with_user(self, path, user, **kwargs):
          
          remote_user = kwargs.get('remote_user', False)
          perms = kwargs.get('perms', self.OCS_PERMISSION_READ)
          if (((not isinstance(perms, int)) or (perms > self.OCS_PERMISSION_ALL))
                  or ((not isinstance(user, six.string_types)) or (user == ''))):
              return False
  
          if remote_user and (not user.endswith('/')):
              user = user + '/'
          path = self._normalize_path(path)
          post_data = {
              'shareType': self.OCS_SHARE_TYPE_REMOTE if remote_user else
              self.OCS_SHARE_TYPE_USER,
              'shareWith': user,
              'path': self._encode_string(path),
              'permissions': perms
          }
  
          res = self._make_ocs_request(
              'POST',
              self.OCS_SERVICE_SHARE,
              'shares',
              data=post_data
          )
  
          if self._debug:
              print('OCS share_file request for file %s with permissions %i '
                    'returned: %i' % (path, perms, res.status_code))
          if res.status_code == 200:
              tree = ET.fromstring(res.content)
              self._check_ocs_status(tree)
              data_el = tree.find('data')
              return ShareInfo(
                                  {
                                      'id': data_el.find('id').text,
                                      'path': path,
                                      'permissions': perms
                                  }
              )
          raise HTTPResponseError(res)
docs: Shares a remote file with specified user
  
          :param path: path to the remote file to share
          :param user: name of the user whom we want to share a file/folder
          :param perms (optional): permissions of the shared object
              defaults to read only (1)
              http://doc.owncloud.org/server/6.0/admin_manual/sharing_api/index.html
          :param remote_user (optional): True if it is a federated users
              defaults to False if it is a local user
          :returns: instance of :class:`ShareInfo` with the share info
              or False if the operation failed
          :raises: HTTPResponseError in case an HTTP error status was returned