title: How to override feathersjs defaults service methods
body: <p>I have a feathersjs service created using the <code>feathers generate service</code> command. I want to override its definition of <code>create</code> method. </p>
  
  <p>This is my service class</p>
  
  <pre><code>/* eslint-disable no-unused-vars */
  // Initializes the `userGroup` service on path `/usergroup`
  const createService = require('feathers-sequelize');
  const createModel = require('../../models/user-group.model');
  const hooks = require('./user-group.hooks');
  const filters = require('./user-group.filters');
  const async = require('async');
  
  module.exports = function () {
    const app = this;
    const Model = createModel(app);
    const paginate = app.get('paginate');
  
    const options = {
      name: 'usergroup',
      Model,
      paginate,
      create: fnCreateGroup // documentation says this allows you to create your own create method
    };
  
    function fnCreateGroup(data, params) {
      let json = {
        done: false
      };
      let permissionIds = Object.keys(data.permissionList), inIds = [];
      for (let i in permissionIds) {
        if (data.permissionList[permissionIds[i]]) {
          inIds.push(parseInt(permissionIds[i]));
        }
      }
      if (inIds.length === 0) {
        json.cause = 'You must provide the permission List';
        return Promise.resolve(json);
      }
      async.parallel([
        function (cb) {
          Model.create({
            groupName: data.groupName
          }).then(function (ug) {
            cb(null, ug);
          }, function (err) {
            cb(err, null);
          });
        },
        function (cb) {
          app.models.permissions.findAll({
            where: {
              id: {
                $in: inIds
              }
            }
          }).then(function (plist) {
            cb(null, plist);
          });
        }
      ]
        , function (err, results) {
        if (typeof err !== 'undefined' &amp;&amp; err !== null) {
          json.err = err;
          return Promise.resolve(json);
        } else {
          let permissions = results[1], group = results[0];
          for (let i = 0; i &lt; permissions.length; i++) {
            group.addPermission(permissions[i]);
          }
          json.done = true;
          json.id = group.id;
          return Promise.resolve(json);
        }
      });
    }
  
    // Initialize our service with any options it requires
    app.use('/usergroup', createService(options));
  
    // Get our initialized service so that we can register hooks and filters
    let service = app.service('usergroup');
  
    service.hooks(hooks);
  
    if (service.filter) {
      service.filter(filters);
    }
  };
  </code></pre>
  
  <p>The test on create method shows the result of original method and not mine.</p>
  
  <p>What can I do?</p>