Giter Club home page Giter Club logo

racer-access's People

Contributors

bnoguchi avatar josephg avatar nateps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

racer-access's Issues

npm release

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?

Tests won't run, Error: cannot find module 'livedb'

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

Clarification of comments versus code on _allow_create

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?

.get not handled with store.allow

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

session.req undefined in store.allow calls

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.