- A user creates a new local user account
- A users comes in through SSO but has no email attribute
- A user updates his own email address
- Someone invites a guest via an email address
- ?
This file contains hidden or 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
| var mailUsersFromTenant = function(tenantAlias, callback) { | |
| // Gets called for every 50 principals | |
| var handlePrincipals = function(principals, next) { | |
| // The `principals` set can contain groups, we just need the users | |
| var users = _.filter(principals, function(principal) { | |
| return PrincipalsUtil.isUser(principal.principalId); | |
| }); |
This file contains hidden or 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
| // 3 model definitions | |
| Furniture = define(...) | |
| Wood = define(...) | |
| Country = define(...) | |
| // A 3-way join table between furniture and wood and country | |
| FurnitureWood = define(); | |
| Furniture.hasMany(FurnitureeWood); |
This file contains hidden or 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
| /** | |
| * Mock the requests that the Passport library would make when verifying a user signing in through Google | |
| * | |
| * @param {String} email The user's email address | |
| * @param {String} displayName The user's display name | |
| */ | |
| var mockGoogleSignInRequests = function(email, displayName) { | |
| // Require nock inline as it messes with the HTTP stack | |
| var nock = require('nock'); |
This file contains hidden or 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
| /** | |
| * Test that verifies that leaving a group removes it from the membership library | |
| */ | |
| it('verify leaving a group removes it from the membership library', function(callback) { | |
| TestsUtil.generateTestUsers(camAdminRestContext, 2, function(err, users, simon, nico) { | |
| assert.ok(!err); | |
| // Simon generates a test group that anyone can join | |
| TestsUtil.generateTestGroups(simon.restContext, 1, function(group) { |
This file contains hidden or 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
| Interesting telemetry points: | |
| ----------------------------- | |
| Below are some questions I thought of that we might like to get | |
| out of whatever system(s) that will back TimeTable. | |
| Sign in | |
| * Number of sign ins per month | |
| * Number of unique users who signed in per month | |
| * Number of sign ins per user per month |
This file contains hidden or 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
| { [SequelizeUniqueConstraintError] | |
| name: 'SequelizeUniqueConstraintError', | |
| message: undefined, | |
| parent: | |
| { [error: duplicate key value violates unique constraint "Tenants_pkey"] | |
| name: 'error', | |
| length: 179, | |
| severity: 'ERROR', | |
| code: '23505', | |
| detail: 'Key (id)=(1) already exists.', |
This file contains hidden or 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
| // Models | |
| var Tenant = sequelize.define('Tenant', { | |
| 'displayName': Sequelize.STRING | |
| }); | |
| var App = sequelize.define('App', { | |
| 'displayName': Sequelize.STRING, | |
| 'hostname': Sequelize.STRING, | |
| 'type': { | |
| 'type': Sequelize.ENUM('timetable'), |
This file contains hidden or 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
| #!/bin/sh | |
| # Get all the non-git, non-oae modules | |
| modules=$(npm ls --depth=0 | grep -v git | grep -v oae- | cut -f 2 -d ' ') | |
| for module in $modules ; do | |
| name=$(echo $module | cut -f 1 -d '@') | |
| version=$(echo $module | cut -f 2 -d '@') | |
| # Get the timestamp | |
| echo $published=$(npm show $module | grep "'$version': '" | cut -f 4 -d "'") $module >> /tmp/published.txt |
This file contains hidden or 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
| // Original at https://github.com/habeanf/annotator/blob/master/src/plugin/marginviewer.coffee | |
| // Generated by CoffeeScript 1.7.1 | |
| (function() { | |
| var clone, | |
| __hasProp = {}.hasOwnProperty, | |
| __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | |
| clone = function(obj) { | |
| var key, newInstance; | |
| if ((obj == null) || typeof obj !== 'object') { |