Skip to content

Instantly share code, notes, and snippets.

@vicapow
Created March 31, 2012 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vicapow/2258841 to your computer and use it in GitHub Desktop.
Save vicapow/2258841 to your computer and use it in GitHub Desktop.
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