|
| 1 | + |
| 2 | +## AccessControl |
| 3 | +#### AccessControl |
| 4 | +**License**: Apache Version 2 |
| 5 | + |
| 6 | +#### new AccessControl() |
| 7 | +The AccessControl object has various methods to control the access for users. |
| 8 | + |
| 9 | + |
| 10 | +### getDefaultOrganization |
| 11 | +#### accessControl.getDefaultOrganization(params) ⇒ <code>string</code> \| <code>undefined</code> |
| 12 | +Get a organization from parameters. |
| 13 | + |
| 14 | +**Returns**: <code>string</code> \| <code>undefined</code> - - organization |
| 15 | + |
| 16 | +| Param | Type | Description | |
| 17 | +| --- | --- | --- | |
| 18 | +| params | <code>object</code> | The parameters | |
| 19 | + |
| 20 | + |
| 21 | +### getAPIToken |
| 22 | +#### accessControl.getAPIToken(params) ⇒ <code>string</code> |
| 23 | +Get a API token from parameters. |
| 24 | + |
| 25 | +**Returns**: <code>string</code> - apiToken |
| 26 | + |
| 27 | +| Param | Type | Description | |
| 28 | +| --- | --- | --- | |
| 29 | +| params | <code>object</code> | The parameters | |
| 30 | + |
| 31 | + |
| 32 | +### setAPIToken |
| 33 | +#### accessControl.setAPIToken(token) |
| 34 | +Sets the API token for the object |
| 35 | + |
| 36 | + |
| 37 | +| Param | Type | Description | |
| 38 | +| --- | --- | --- | |
| 39 | +| token | <code>string</code> | The api token to use | |
| 40 | + |
| 41 | + |
| 42 | +### getAPIUrl |
| 43 | +#### accessControl.getAPIUrl(cloudAPIUrl) ⇒ <code>string</code> |
| 44 | +Get a API url from cloudAPIUrl |
| 45 | + |
| 46 | +**Returns**: <code>string</code> - apiUrl |
| 47 | + |
| 48 | +| Param | Type | Description | |
| 49 | +| --- | --- | --- | |
| 50 | +| cloudAPIUrl | <code>string</code> | The base url for cloud | |
| 51 | + |
| 52 | + |
| 53 | +### getUserRoles |
| 54 | +#### accessControl.getUserRoles() ⇒ <code>Promise</code> |
| 55 | +Get all the system database roles types. |
| 56 | + |
| 57 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 58 | + |
| 59 | +### createOrganization |
| 60 | +#### accessControl.createOrganization(orgName) ⇒ <code>Promise</code> |
| 61 | +Any user can create their own organization. |
| 62 | + |
| 63 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 64 | + |
| 65 | +| Param | Type | Description | |
| 66 | +| --- | --- | --- | |
| 67 | +| orgName | <code>string</code> | The organization name to create | |
| 68 | + |
| 69 | + |
| 70 | +### ifOrganizationExists |
| 71 | +#### accessControl.ifOrganizationExists(orgName) ⇒ <code>Promise</code> |
| 72 | +Check if the organization exists. |
| 73 | + |
| 74 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 75 | + |
| 76 | +| Param | Type | Description | |
| 77 | +| --- | --- | --- | |
| 78 | +| orgName | <code>string</code> | The organization name to check if exists. | |
| 79 | + |
| 80 | + |
| 81 | +### removeUserFromOrg |
| 82 | +#### accessControl.removeUserFromOrg(userId, [orgName]) ⇒ <code>Promise</code> |
| 83 | +Remove an user from an organization, only an admin user can remove an user from an organization |
| 84 | + |
| 85 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 86 | + |
| 87 | +| Param | Type | Description | |
| 88 | +| --- | --- | --- | |
| 89 | +| userId | <code>string</code> | The if of the user to be removed. | |
| 90 | +| [orgName] | <code>string</code> | The organization name in which the user is to be removed. | |
| 91 | + |
| 92 | + |
| 93 | +### getPendingOrgInvites |
| 94 | +#### accessControl.getPendingOrgInvites([orgName]) ⇒ <code>Promise</code> |
| 95 | +Get the pending invitations list. |
| 96 | + |
| 97 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 98 | + |
| 99 | +| Param | Type | Description | |
| 100 | +| --- | --- | --- | |
| 101 | +| [orgName] | <code>string</code> | The organization name. | |
| 102 | + |
| 103 | + |
| 104 | +### sendOrgInvite |
| 105 | +#### accessControl.sendOrgInvite(userEmail, role, [note], [orgName]) ⇒ <code>Promise</code> |
| 106 | +Send a new invitation |
| 107 | + |
| 108 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 109 | + |
| 110 | +| Param | Type | Description | |
| 111 | +| --- | --- | --- | |
| 112 | +| userEmail | <code>string</code> | The email of user. | |
| 113 | +| role | <code>string</code> | The role for user. | |
| 114 | +| [note] | <code>string</code> | The note to send with the invitation. | |
| 115 | +| [orgName] | <code>string</code> | The organization name. | |
| 116 | + |
| 117 | + |
| 118 | +### getOrgInvite |
| 119 | +#### accessControl.getOrgInvite(inviteId, [orgName]) ⇒ <code>Promise</code> |
| 120 | +Get the invitation info |
| 121 | + |
| 122 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 123 | + |
| 124 | +| Param | Type | Description | |
| 125 | +| --- | --- | --- | |
| 126 | +| inviteId | <code>string</code> | The invite id to retrieve. | |
| 127 | +| [orgName] | <code>string</code> | The organization name. | |
| 128 | + |
| 129 | + |
| 130 | +### deleteOrgInvite |
| 131 | +#### accessControl.deleteOrgInvite(inviteId, [orgName]) ⇒ <code>Promise</code> |
| 132 | +Delete an invitation |
| 133 | + |
| 134 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 135 | + |
| 136 | +| Param | Type | Description | |
| 137 | +| --- | --- | --- | |
| 138 | +| inviteId | <code>string</code> | The invite id to delete. | |
| 139 | +| [orgName] | <code>string</code> | The organization name. | |
| 140 | + |
| 141 | + |
| 142 | +### updateOrgInviteStatus |
| 143 | +#### accessControl.updateOrgInviteStatus(inviteId, accepted, [orgName]) ⇒ <code>Promise</code> |
| 144 | +Accept /Reject invitation |
| 145 | + |
| 146 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 147 | + |
| 148 | +| Param | Type | Description | |
| 149 | +| --- | --- | --- | |
| 150 | +| inviteId | <code>string</code> | The invite id to updated. | |
| 151 | +| accepted | <code>boolean</code> | The status of the invitation. | |
| 152 | +| [orgName] | <code>string</code> | The organization name. | |
| 153 | + |
| 154 | + |
| 155 | +### getOrgUsers |
| 156 | +#### accessControl.getOrgUsers([orgName]) ⇒ <code>Promise</code> |
| 157 | +Get all the organization's users and roles |
| 158 | + |
| 159 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 160 | + |
| 161 | +| Param | Type | Description | |
| 162 | +| --- | --- | --- | |
| 163 | +| [orgName] | <code>string</code> | The organization name. | |
| 164 | + |
| 165 | + |
| 166 | +### getDatabaseRolesOfUser |
| 167 | +#### accessControl.getDatabaseRolesOfUser(userId, [orgName]) ⇒ <code>Promise</code> |
| 168 | +Get the user's role for every databases under the organization |
| 169 | + |
| 170 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 171 | + |
| 172 | +| Param | Type | Description | |
| 173 | +| --- | --- | --- | |
| 174 | +| userId | <code>string</code> | The user's id. | |
| 175 | +| [orgName] | <code>string</code> | The organization name. | |
| 176 | + |
| 177 | + |
| 178 | +### assignUserRole |
| 179 | +#### accessControl.assignUserRole(userId, scope, role, [orgName]) ⇒ <code>Promise</code> |
| 180 | +Assign user's a role for a resource (organization/database) |
| 181 | + |
| 182 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 183 | + |
| 184 | +| Param | Type | Description | |
| 185 | +| --- | --- | --- | |
| 186 | +| userId | <code>string</code> | The user's id. | |
| 187 | +| scope | <code>string</code> | The resource name/id. | |
| 188 | +| role | <code>string</code> | The user role to be assigned. | |
| 189 | +| [orgName] | <code>string</code> | The organization name. | |
| 190 | + |
| 191 | + |
| 192 | +### updateUserRole |
| 193 | +#### accessControl.updateUserRole(userId, capabilityId, scope, role, [orgName]) ⇒ <code>Promise</code> |
| 194 | +Update user's a role for a resource (organization/database) |
| 195 | + |
| 196 | +**Returns**: <code>Promise</code> - A promise that returns the call response object, or an Error if rejected. |
| 197 | + |
| 198 | +| Param | Type | Description | |
| 199 | +| --- | --- | --- | |
| 200 | +| userId | <code>string</code> | The user's id. | |
| 201 | +| capabilityId | <code>string</code> | The capability id. | |
| 202 | +| scope | <code>string</code> | The resource name/id. | |
| 203 | +| role | <code>string</code> | The user role to be updated. | |
| 204 | +| [orgName] | <code>string</code> | The organization name. | |
| 205 | + |
0 commit comments