These are chat archives for meteor-shuttler/graphs

Mar 2016
Ivan S Glazunov
Mar 04 2016 00:02
In the classic sense of the inheritance is the "class" as a set of properties.
Here every tree option-independent property. Inheritance enables you to impose a property-graph to documents on another graph.
Now is active the demo:
Collections on server:
documents = new Mongo.Collection('documents');

used = new Mongo.Collection('used');

right = new Mongo.Collection('right');

if (Meteor.isServer) {{
        graph: 'used',
        field: 'source',
        from: 'target',
        to: 'source'
        graph: 'used',
        field: 'source',
        from: 'target',
        to: 'link'
AttachSelect andselect - methods are not yet published package. It does works as used.inheritTree(right) in
Ivan S Glazunov
Mar 04 2016 00:15
I recommend to execute the following commands in the console of browser for understanding:
// Remove all right links
right.find().forEach(function(r) { right.remove(r._id); });
// If target of right link is reference to subject, and source is reference to object of this rule
// then give to "user" document №3 this "right" to structure from document 2.'2'), documents.findOne('1'));
// You can also update any links.
// For example to transfer this right from the user 1 to user 3.
right.update(RETURNEDID, { $set: { '': '3'} });
This makes it possible without searching in tree easily to know which properties have the document.
Ivan S Glazunov
Mar 04 2016 00:30

For example like this:

// In future versions it will be something like this:
Shuttler.can((graph: Mongo.Collection)|(restrict: String), object?: Document, user? (id: String)|Document) => Boolean

This same method can be used to check for the "literal" right to a certain action.
With package

    someMyAction: function(userId, document) {
         if (userId && Shuttler.can(Shuttler.FetchAllow, document, userId)) return false;
         else throw new Meteor.Error('You can not this...');
Shuttler.can('someMyAction, Collection.findOne(), Meteor.userId()); // Boolean
Shuttler.can.why('someMyAction, Collection.findOne(), Meteor.userId());
// thrown "You can not this..." if has error
// return true if send restrict
// return link in graph if graph sended

In demo
Red links - examples of some right
Blue links - example of some tree structure (as directories, comments, categories...)
Black documents - as posts, users and other atomic independent entities

You can delete , insert and update anything. Just please do not make eternal cycles ))

Ivan S Glazunov
Mar 04 2016 00:43
I am currently working on a mutually exclusive trees. To be able to create a tree own.allow, but on top imposeown.deny stopping the spread of own.allow.
Simple example:
User A is owner if himself. In own.allow has link A->A. It inherits to all his documents.
User A insert document 1. Auto inherit 1->A in own.allow
User B is owner if himself. In own.allow has link B->B. It inherits to all his documents.
User B insert document 2. Auto inherit 2->A in own.allow
Users A and B is a parts of group C
User B insert to graph own.deny link 2->C. It prohibits members of the group C to own something in the comments tree of the document 2.
Link 2->A automatically removed, because is prohibits.
Now, members of the group C can not own, which means edit their comments on this tree.

Nesting on the demo page, is understood as follows:


Ivan S Glazunov
Mar 04 2016 00:54

Nice to represent what will be if you make trees of different trees rights as:

  • own.allow own.deny
  • fetch.allow fetch.deny
  • update.allow update.deny
  • remove.allow remove.deny
  • delete.allow delete.deny (not remove, just mark as deleted...)
  • comment.allow comment.deny
  • buy.allow buy.deny
  • task.allow task.deny (can change status of "task")

and different semantic trees as:

  • comments comment-drafts
  • tasks.done (link from the task -> user who closed the task)
  • template-nesting (Nesting in a 2 dimensional space element width and height. For visual editors.) { _source, _target, x, y, width, height, template: String, options: Object }
Ivan S Glazunov
Mar 04 2016 03:28
Published package for selection-inheritance.
Work on it continues.
Mar 04 2016 14:47
When you talk about actions, what do you mean?
Ivan S Glazunov
Mar 04 2016 16:35
The meteor has 3 standard actions that you can check and limit using the allow or deny. insert, update and remove. With the package you an create your own actions.
Ivan S Glazunov
Mar 04 2016 16:44
actions == operations Soon there will be demos with detailed examples.
Mar 04 2016 19:20
can you upload that demo to github?
aaaand it's gone
Ivan S Glazunov
Mar 04 2016 20:16
This message was deleted
This message was deleted