ftos.identity.authz.setGrantTagOnRecord
IMPORTANT!
Starting with v24.3.0, this is renamed from server.customSecurity.setGrantTagOnRecord to ftos.identity.authz.setGrantTagOnRecord.
Starting with v24.3.0, this is renamed from server.customSecurity.setGrantTagOnRecord to ftos.identity.authz.setGrantTagOnRecord.
Assigns a custom data ownership tag to an entity record.
IMPORTANT!
The entity must have the Support Data Ownership Custom Scope option enabled in the business entity editor.
The entity must have the Support Data Ownership Custom Scope option enabled in the business entity editor.
Use the ftos.identity.authz.createGrantTag method to create the tag.
Use the ftos.identity.authz.setGrantTagToUser method to assign CRUD (Create, Read, Update, Delete) access to specific user accounts for the entity record.
This is a data service method for business service components.
Syntax
Copy
ftos.identity.authz.setGrantTagOnRecord(entityName : string, recordId: string, dataOwnershipGrantId: string): void;
| Parameter | Type | Description |
|---|---|---|
entityName
|
string | Name of the parent entity of the record you wish to assign custom data ownership. |
recordId
|
string | ID of the record you wish to assign custom data ownership. |
dataOwnershipGrantId
|
string | Data ownership tag ID (created using the ftos.identity.authz.createGrantTag method). |
Examples
In this example, we wish to assign two different users with access to the same bank account, which means that both user accounts will need to CRUD privileges over the same record in the bankAccounts entity:
- We use the ftos.identity.authz.createGrantTag method to generate a data ownership tag and we save it in the tagId variable.
- We assign the tag to the 76e61107-3729-4a46-bc70-435086ce0571 record in the bankAccounts entity.
- We use the ftos.identity.authz.setGrantTagToUser method to assign the tag to user accounts d4ba4503-bddd-4ac9-a8ff-0b9e99572af3 and 2FE5697F-56D7-4BE3-B61B-D3CF16FA0E13.
Copy
var tagId = ftos.identity.authz.createGrantTag("Joint account 61");
ftos.identity.authz.setGrantTagOnRecord("bankAccounts", "76e61107-3729-4a46-bc70-435086ce0571", tagId);
ftos.identity.authz.setGrantTagToUser("d4ba4503-bddd-4ac9-a8ff-0b9e99572af3", tagId);
ftos.identity.authz.setGrantTagToUser("2FE5697F-56D7-4BE3-B61B-D3CF16FA0E13", tagId);