Created
March 31, 2012 02:51
-
-
Save vicapow/2258841 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
example_user = { | |
// a list of 0 or more group ids of the groups this user belongs to | |
_groups : [_group1ID,_group2ID,...] | |
// a list of 0 or more roles | |
, roles : ['user','admin'...] | |
, fname : 'Some' | |
, lname : 'User' | |
, prettyUsername : 'UsEr' | |
, username : 'user' | |
, email : 'someuser@example.com' | |
, password : 'somehashedpassword' | |
, enabled : true | |
, version : 1 // the edit version | |
, sessions : [{ | |
token : 'somereallylongrandomtokenstring' | |
, timesetamp : new Date() | |
// possibly more active session tokens | |
}] | |
} | |
example_group = { | |
title : 'The title of the group' | |
, version : 0 // the edit version | |
, _creator : user1ID // the id of the user would created this group | |
} | |
example_resource = { | |
// all resources could extend a resource schema that | |
// might look like the following | |
access : { | |
groups: [{ | |
_id : groupID | |
, can: ['read','edit','remove'] | |
}] | |
, users: [{ | |
_id : userID | |
, can: ['read','edit','remove'] | |
}] | |
, _owner: ownerID | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment