src/access.js
function(scope, mode) {
    if (typeof(scope) !== 'string' || scope.indexOf('/') !== -1 || scope.length === 0) {
      throw new Error('Scope should be a non-empty string without forward slashes');
    }
    if (!mode.match(/^rw?$/)) {
      throw new Error('Mode should be either \'r\' or \'rw\'');
    }
    this._adjustRootPaths(scope);
    this.scopeModeMap[scope] = mode;
  }
function(scope, mode) {
    if (typeof(scope) !== 'string' || scope.indexOf('/') !== -1 || scope.length === 0) {
      throw new Error('Scope should be a non-empty string without forward slashes');
    }
    if (!mode.match(/^rw?$/)) {
      throw new Error('Mode should be either \'r\' or \'rw\'');
    }
    this._adjustRootPaths(scope);
    this.scopeModeMap[scope] = mode;
  }
Claim access on a given scope with given mode.

@param {string} scope - An access scope, such as "contacts" or "calendar"
@param {string} mode - Access mode. Either "r" for read-only or "rw" for read/write