-
-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preconditions in a service (Socket.IO) #48
Comments
Good timing, we're just discussing filtering SocketIO events in #44 for 0.4.0 that will be released soon. It will probably look like this: var TodoService = {
remove: function(id, params, callback) {
},
update: function(id, data, params, callback) {
},
create: function(data, params, callback) {
},
removed: function(data, params, callback) {
// e.g. restrict by data company id
if(params.user.companyId !== data.companyId) {
return callback(null, false);
}
callback(null, data);
},
updated: function(data, params, callback) {
// restrict by data company id
if(params.user.companyId !== data.companyId) {
return callback(null, false);
}
// This will also allow to convert the data sent
callback(null, { converted: data });
},
created: function(data, params, callback) {
// TODO implement
}
} Where the |
BREAKING CHANGE: This module no longer supports Node.js 0.10
BREAKING CHANGE: This module no longer supports Node.js 0.10
Use AST transformations to import generated services and hooks
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs. |
Hi,
I implemented the REST authentication mentioned in #43 .
Now I want the same for the Socket.IO communication.
A user can use the find and get service but for create, update and delete he has to be logged in. Is there a way with feathersjs to implement that?
The text was updated successfully, but these errors were encountered: