Skip to content

Commit

Permalink
Update node-js.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
krajiv authored Apr 30, 2024
1 parent 6c4b92d commit 16e9d93
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/guide/connectors/ecf/node-js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -721,9 +721,8 @@ The code utilizes the Google Sheets API to write data to a specific spreadsheet.
* Calls the ```writeDataToSheet``` function with the sample data object.
* This code demonstrates how to connect to Google Sheets via the API, authenticate, and write data to a specific sheet in a specific format. You can modify the data object and target range (```Accounts!A:A```) to suit your needs.

### Provision Account-Role membership (Access provisioning):

Below is sample code which can be used to provision a role access to an account. This uses sample hardcoded input data, ideally this will be received by your custom connector from EIC when add access task for role is provisioned, you should read this data from request body and process it further.
### Access Provisioning ( Add a role to an account)
Here is a sample code that can be utilized to grant role access to an account. This code includes hardcoded input data for demonstration purposes. Typically, your custom connector would receive this data from EIC when an 'add access' task for a role is provisioned. In practice, you would extract this data from the request body and proceed with further processing.

```javascript
const { google } = require('googleapis');
Expand Down Expand Up @@ -767,4 +766,7 @@ const data = {
// Call the function to write data to the Google Sheet
writeDataToSheet(data);
```
<b><u>Explanation</u></b>
The code provisions account-role memberships (access) by writing data to a Google Sheet (for logging) in this example. It simulates the process, but for real-world use, you'll need to replace the Google Sheets part with calls to your system's actual access control API.

The code defines a function ```writeDataToSheet``` that takes an object with ```accountID``` and ```entitlementID``` (```role ID```). This function currently logs the data, but should be replaced with your system's access provisioning logic (calling an API or updating a database).

0 comments on commit 16e9d93

Please sign in to comment.