Comments (2)
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 created
, updated
and removed
params will be the handshake data set during SocketIO authorization. The trickier part I think is a plugin that does shared authorization between Express and SocketIO also existing methods like this one should already work.
from feathers.
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.
from feathers.
Related Issues (20)
- Question
- Oauth Issue using feathers-chat-app V5 HOT 1
- Hooks should run on non-enabled methods
- Generated package.json is missing a `migrate:make` script HOT 3
- Express HTTPS Fails HOT 1
- Register multiple Express middleware functions HOT 1
- Calls to feathers services with HEAD method are throwing an error since v5.x. HOT 2
- Profile not being returned from google oauth redirect HOT 1
- Error in patch: RangeError: Maximum call stack size exceeded HOT 1
- $in query with mongoDB - difference between 5.0.23 and 5.0.24 HOT 2
- Help for implement to NUXT v3 server
- Postgres jsonb best practice
- Calling authenticate() method take long
- Many-to-many / join tables
- Schema definition circular references HOT 1
- Logging in with a custom auth strategy results in undefined user in connection in channels.ts
- Cannot redefine property: Symbol(@feathersjs/schema/dispatch)
- FeatherJS Apple SSO sign in issue HOT 2
- Find Query - test if column is null
- context.params & context.data typed any for MongoDBService
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feathers.