updateRoleOfPrincipalAtFarm
@svenvw/fdm-source / fdm-core/src / updateRoleOfPrincipalAtFarm
Function: updateRoleOfPrincipalAtFarm()
updateRoleOfPrincipalAtFarm(
fdm
,principal_id
,target
,b_id_farm
,role
):Promise
<void
>
Defined in: fdm-core/src/farm.ts:358
Updates the role of a principal for a given farm.
This function checks if the acting principal has 'share' permission on the farm, then updates the specified role of the grantee.
Parameters
fdm
any
The FDM instance providing the connection to the database. The instance can be created with createFdmServer.
principal_id
any
The identifier of the principal performing the update (must have 'share' permission).
target
string
The username, email or slug of the principal whose role is being updated.
b_id_farm
any
The identifier of the farm.
role
The new role to assign ('owner', 'advisor', or 'researcher').
"owner"
| "advisor"
| "researcher"
Returns
Promise
<void
>
Throws
If the acting principal does not have 'share' permission, or if any other error occurs during the operation.