Skip to content

Commit dac890d

Browse files
committed
add role_update
1 parent ea92835 commit dac890d

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

lib/connectionConfig.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,15 @@ ConnectionConfig.prototype.classFrameURL = function() {
413413
return this.branchBase('frame')
414414
}
415415

416+
/**
417+
* get the url to update the organization role in the system database
418+
* don't change the end point (this is a terminus db server end point)
419+
* @returns {string}
420+
*/
421+
ConnectionConfig.prototype.updateOrganizationRoleURL = function() {
422+
return `${this.apiURL()}update_role`
423+
}
424+
416425
/**
417426
* Generate URL for clone db endpoint
418427
* @param {string} [newRepoId] the repository id

lib/woqlClient.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,28 @@ WOQLClient.prototype.createOrganization = function(orgId, orgDoc) {
11301130
)
11311131
}
11321132

1133+
1134+
/**
1135+
* Create a new organization for the registered user
1136+
* @param {string} orgId - the organization id
1137+
* @param {object} orgDoc - An object that describe the organization's details
1138+
* @returns {Promise} A promise that returns the call response object, or an Error if rejected.
1139+
*/
1140+
1141+
WOQLClient.prototype.setOrganizationRoles = function(payload, orgDoc) {
1142+
//if (orgId) {
1143+
return this.dispatch(
1144+
CONST.CREATE_ORGANIZATION,
1145+
this.connectionConfig.updateOrganizationRoleURL(),
1146+
payload,
1147+
)
1148+
//}
1149+
//let errmsg = `Create organization parameter error - you must specify a valid organization id`
1150+
/* return Promise.reject(
1151+
new Error(ErrorMessage.getInvalidParameterMessage(CONST.CREATE_ORGANIZATION, errmsg)),
1152+
)*/
1153+
}
1154+
11331155
/**
11341156
* Gets all the information about the given organization
11351157
* @param {string} orgId - the organization id
@@ -1206,7 +1228,7 @@ WOQLClient.prototype.getRoles = function(userId, orgId, dbId) {
12061228
}
12071229

12081230
/**
1209-
* Change the user role for existing users in your organisation, including your own
1231+
* Change the user role for existing users in your organization, including your own
12101232
* @param {typedef.RolesObj} newRolesObj
12111233
* @returns {Promise} A promise that returns the call response object, or an Error if rejected.
12121234
*/

0 commit comments

Comments
 (0)