This repository was archived by the owner on Sep 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
LoginAPI & User Model
Kieran Sedgwick edited this page Dec 3, 2013
·
11 revisions
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true
},
email: {
type: DataTypes.STRING,
allowNull: false,
unique: true
},
username: {
type: "VARCHAR(20)",
allowNull: false,
unique: true
},
fullName: {
type: DataTypes.STRING,
allowNull: false,
unique: false
},
deletedAt: {
type: DataTypes.DATE,
allowNull: true
},
isAdmin: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
isCollaborator: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
isSuspended: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
sendNotifications: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
sendEngagements: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
sendEventCreationEmails: {
type: DataTypes.BOOLEAN,
defaultValue: true
},
wasMigrated: {
type: DataTypes.BOOLEAN,
defaultValue: false
}
}-
POST /userPurpose: Create a new Webmaker account. Call Parameters: n/a Expected info: Minimum: { email: STRING | Persona email, username: STRING } Return: { error: STRING, user: Webmaker User Object } Security: Persona credentials -
PUT /user/:emailPurpose: Update a Webmaker profile Call Parameters: :email - the "email" parameter of the Webmaker User model (see schema at top of page) Expected info: A JSON object containing the attributes being updated Return: { err: STRING, user: Webmaker User Object (see schema at top of page) } Security: Basicauth for server-to-server. Persona credentials + associated admin account. -
GET /user/id/:idPurpose: Return a copy of the user's Webmaker User model object. Call Parameters: :id - the "id" parameter of the Webmaker User model (see schema at top of page) Expected info: N/A Return: { err: STRING, user: Webmaker User Object (see schema at top of page) } Security: Basicauth for server-to-server. Otherwise, persona credentials + associated webmaker account. Unless they have admin permissions, users can only retrieve their own account details. -
GET /user/username/:usernamePurpose: Return a copy of the user's Webmaker User model object Call Parameters: :username - the "username" parameter of the Webmaker User model (see schema at top of page) Expected info: N/A Return: { err: STRING, user: Webmaker User Object (see schema at top of page) } Security: Basicauth for server-to-server. Otherwise, persona credentials + associated webmaker account. Unless they have admin permissions, users can only retrieve their own account details. -
GET /user/email/:emailPurpose: Return a copy of the user's Webmaker User model object. Call Parameters: :email - the "email" parameter of the Webmaker User model (see schema at top of page) Expected info: N/A Return: { err: STRING, user: Webmaker User Object (see schema at top of page) } Security: Basicauth for server-to-server. Otherwise, persona credentials + associated webmaker account. Unless they have admin permissions, users can only retrieve their own account details. -
DELETE /user/:emailPurpose: Delete a User from the Webmaker database Call Parameters: :email - the "email" parameter of the Webmaker User model (see schema at top of page) Expected info: N/A Return: { err: STRING } Security: Basicauth for server-to-server. Persona credentials + associated admin account. -
PUT /account/updatePurpose: Delete a User from the Webmaker database Call Parameters: :email - the "email" parameter of the Webmaker User model (see schema at top of page) Expected info: N/A Return: { err: STRING } Security: Basicauth for server-to-server. Persona credentials + associated admin account. -
POST /account/deletePurpose: Delete a User from the Webmaker database Call Parameters: :email - the "email" parameter of the Webmaker User model (see schema at top of page) Expected info: N/A Return: { err: STRING } Security: Basicauth for server-to-server. Persona credentials + associated admin account.