Skip to content

Commit

Permalink
fix:adds-hook-prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhaev26 committed Mar 4, 2024
1 parent 13c2f07 commit 4a4abe6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
Binary file modified audio.mp3
Binary file not shown.
Binary file modified audio.wav
Binary file not shown.
10 changes: 10 additions & 0 deletions core/src/hooks/block-self-delete.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Use this hook to manipulate incoming or outgoing data.
// For more information on hooks see: http://docs.feathersjs.com/api/hooks.html
import { Hook, HookContext } from '@feathersjs/feathers';

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export default (options = {}): Hook => {
return async (context: HookContext): Promise<HookContext> => {
return context;
};
};
6 changes: 4 additions & 2 deletions core/src/services/admin/admin.hooks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { HooksObject } from '@feathersjs/feathers';
import * as authentication from '@feathersjs/authentication';
import RolesEnum from '../../constants/roles.enum';
import Permit from '../../hooks/permit';
// Don't remove this comment. It's needed to format import lines nicely.

const { authenticate } = authentication.hooks;
Expand All @@ -9,10 +11,10 @@ export default {
all: [ authenticate('jwt') ],
find: [],
get: [],
create: [],
create: [Permit(RolesEnum.PLATFORM_SUPER_ADMIN)],
update: [],
patch: [],
remove: []
remove: [Permit(RolesEnum.PLATFORM_SUPER_ADMIN)]
},

after: {
Expand Down

0 comments on commit 4a4abe6

Please sign in to comment.