Add schema skeletons for built-in models

This commit is contained in:
Raymond Feng 2013-06-26 16:25:51 -07:00
parent b00248cc18
commit 8ec0533eb4
5 changed files with 84 additions and 0 deletions

17
lib/models/acl.js Normal file
View File

@ -0,0 +1,17 @@
// Schema ACL options
// Object level permissions
// open: no protection
// none: always rejected
// owner: only the owner
// loggedIn: any logged in user
// roles: logged in users with the roles
// related: owner of the related objects
// Class level permissions
// scopes
// URL level permissions

41
lib/models/application.js Normal file
View File

@ -0,0 +1,41 @@
// Application model
var ApplicationSchema = {
// Basic information
id: {type: String, required: true},
name: {type: String, required: true},
description: String, // description
icon: String, // The icon url
public: Boolean,
permissions: [String],
userId: String,
status: String,
// Keys
clientKey: String,
javaScriptKey: String,
restApiKey: String,
windowsKey: String,
masterKey: String,
// Push notification
pushPlatforms: [String],
pushCredentials: [],
// Authentication
authenticationEnabled: Boolean,
anonymousAllowed: Boolean,
schemes: [String], // Basic, facebook, github, google
attachedCredentials: [],
// email
email: String, // e-mail address
emailVerified: Boolean, // Is the e-mail verified
collaborators: [String], // A list of users ids who have permissions to work on this app
created: Date,
lastUpdated: Date
};

View File

@ -0,0 +1,4 @@
// Device registration
var InstallationSchema = {
};

11
lib/models/role.js Normal file
View File

@ -0,0 +1,11 @@
// Role model
var RoleSchema = {
id: {type: String, required: true},
name: {type: String, required: true},
roles: [String],
users: [String],
acl: [],
created: Date,
lastUpdated: Date
}

11
lib/models/user.js Normal file
View File

@ -0,0 +1,11 @@
// User model
var UserSchema = {
id: {type: String, required: true},
username: {type: String, required: true},
password: String,
authData: [],
email: String,
emailVerified: Boolean,
created: Date,
lastUpdated: Date
}