Skip to content

subject role map request issues with redis? #11

@rssk

Description

@rssk

First off, awesome module! I think I'm running into some issues when I'm grabbing subject role mappings w/ this example code:

var relations = require('relations');
var redis = require('redis');

client = redis.createClient();

relations.use(relations.stores.redis, {client: client});
relations.define('repo', {
  owner: ['pull', 'push', 'administrate'],
  collaborator: ['pull', 'push']
});

relations.repo('%s is the owner of %s', 'ross', 'testrepo');
relations.repo('%s is the collaborator of %s', 'ross', 'testrepo');
relations.repo('explain who can act on testrepo', function(err, res) {
    console.log(res);
});

which gives

test$ node index.js 
{ testrepo: [ 'collaborator', 'owner' ] }

Which seems to have the object as the subject?

In the redis tests I see prefix has a : in the prefix name (https://github.com/carlos8f/node-relations/blob/master/test/basic.js#L12)
and they seem to be parsed that way as well (https://github.com/carlos8f/node-relations/blob/master/stores/redis.js#L212). Should prefixes contain colons?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions