Add rolesJson to groups table

This will contain the roles ('role definition') of a group of
users. We will internally map these to our API scopes.
This commit is contained in:
Girish Ramakrishnan
2018-06-14 21:12:52 -07:00
parent 5e09f3dcb2
commit a77d45f5de
15 changed files with 135 additions and 36 deletions
+1 -2
View File
@@ -34,7 +34,6 @@ var assert = require('assert'),
debug = require('debug')('box:user'),
DatabaseError = require('./databaseerror.js'),
eventlog = require('./eventlog.js'),
groupdb = require('./groupdb.js'),
groups = require('./groups.js'),
GroupsError = groups.GroupsError,
hat = require('./hat.js'),
@@ -518,7 +517,7 @@ function createOwner(username, password, email, displayName, auditSource, callba
if (count !== 0) return callback(new UsersError(UsersError.ALREADY_EXISTS, 'Owner already exists'));
// have to provide the group id explicitly so using db layer directly
groupdb.add(constants.ADMIN_GROUP_ID, constants.ADMIN_GROUP_NAME, function (error) {
groups.addOwnerGroup(function (error) {
// we proceed if it already exists so we can re-create the owner if need be
if (error && error.reason !== DatabaseError.ALREADY_EXISTS) return callback(new UsersError(UsersError.INTERNAL_ERROR, error));