DEPRECATED. DO NOT USE.
codeparty / racer-access Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED. DO NOT USE.
DEPRECATED. DO NOT USE.
DEPRECATED. DO NOT USE.
Any chance of a 0.0.1 release as-is? If not, what work still needs to be completed before that can happen?
Given that the preValidate
hook will continue to be synchronous, is there any reason that pending resolution of share/sharedb#14 might hold back a release of this?
Was the original intent to fold these helpers directly into racer core instead of releasing as a separate package, perhaps?
If you do a clean install,
$ git clone [email protected]:codeparty/racer-access
$ cd racer-access
$ npm install
and try to run tests ... you are boned.
$ make
./node_modules/.bin/mocha \
--reporter spec \
--grep "" \
--compilers .coffee:coffee-script \
./test/*.coffee | tee
module.js:340
throw err;
^
Error: Cannot find module 'livedb'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/mrluc/scratch/racer-access/node_modules/racer/node_modules/share/lib/server/index.js:3:14)
at Module._compile (module.js:456:26)
...
Maybe related to share/sharedb#4
This may simply be me not understanding something here, so mainly I am requesting a clarification.
On lines 171-186 where _allow_create is commented and defined
/**
* A convenience method for declaring access control on creates, based on the
* value of the document before the operation is applied to it.
* @param {String} collectionName
* @param {Function} callback(docId, opData, doc, connectSession, next)
* where next(docId, opData, docBeforeOp, session, next)
*/
Store.prototype._allow_create = function (pattern, validate) {
this.shareClient._validatorsCreate.push(
function (collection, docName, opData, snapshotData, connectSession) {
if (! collectionMatchesPattern(collection, pattern)) return;
var newDoc = opData.create.data;
return validate(docName, newDoc, connectSession);
}
);
};
Is the @param {Function} callback(docId, opData, doc, connectSession, next)
in the comments supposed to correlate to validate(docName, newDoc, connectSession)
in the code?
Hi!
I've tried to block read access to collections/paths with racer-access
but failed.
Controlling write requests works perfectly fine but it seems that get
is not handled.
I setup the following rule:
store.allow 'all', 'users**', () ->
for i of arguments
console.log "store.allow", i, arguments[i]
Whenever I do a model.set/.del/.create
a console.log
shows me the request.
When I do a model.get/.fetch
on users.test
, nothing happens. The callback is not called.
Am I missing something in my setup or is there something wrong with racer-access
?
Thanks,
Mario
For example
this.store.allow("change", "prospects.*.legalName", function( docId, newDoc, docBeforeChange, session ){
console.log( session.req ); //undefined
});
I've spent a few hours trying to debug using node-inspector this but quite frankly I am in over my head. There are layers of interaction occurring and it is not clear when or where the req variable is not being updated properly. There was a place in the code that looked suspect but I am having trouble finding it at the moment, I will update this again later if I can remember where it was.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.