Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Commit

Permalink
fix restrict to owner hook methods. Closes #228
Browse files Browse the repository at this point in the history
  • Loading branch information
ekryski committed Aug 10, 2016
1 parent 880ca97 commit 2c49e00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/restrict-to-owner.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function(options = {}){
throw new Error(`The 'restrictToOwner' hook should only be used as a 'before' hook.`);
}

if (!hook.id) {
if (hook.method === 'find') {
throw new errors.MethodNotAllowed(`The 'restrictToOwner' hook should only be used on the 'get', 'update', 'patch' and 'remove' service methods.`);
}

Expand Down

0 comments on commit 2c49e00

Please sign in to comment.