How to set visibility visibility to "moleculer-db" mixin registers actions #1016
sachinda123456
started this conversation in
General
Replies: 2 comments
-
This question is too actual for me to. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have not tested this myself but my understanding is that you can provide an additional service mixin to modify the DB adapter mixin actions. This would work similar to the ability to disable these actions altogether as documented here. Example setting actions to "use strict";
const { ServiceBroker } = require("moleculer");
const DbService = require("moleculer-db");
const broker = new ServiceBroker();
broker.createService({
name: "users",
mixins: [
DbService,
{
actions: {
list: { visibility: 'private' },
find: { visibility: 'private' },
count: { visibility: 'private' },
create: { visibility: 'private' },
insert: { visibility: 'private' },
update: { visibility: 'private' },
remove: { visibility: 'private' },
}
}
],
settings: {
fields: ["_id", "username", "name"]
},
afterConnected() {
// Seed the DB with ˙this.create`
}
});
broker.start() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to know if there any way to set visibility level to moleculer-db default operations such as
/**
* - list
* - find
* - count
* - create
* - insert
* - update
* - remove
*/
Beta Was this translation helpful? Give feedback.
All reactions