Skip to main content

listPrincipalsForFarm

@svenvw/fdm-source


@svenvw/fdm-source / fdm-core/src / listPrincipalsForFarm

Function: listPrincipalsForFarm()

listPrincipalsForFarm(fdm, principal_id, b_id_farm): Promise<Principal[]>

Defined in: fdm-core/src/farm.ts:470

Lists all principals (users or organizations) associated with a specific farm.

This function checks if the acting principal has 'read' permission on the farm, then retrieves a list of all principals that have any role on the farm.

Parameters

fdm

any

The FDM instance providing the connection to the database. The instance can be created with createFdmServer.

principal_id

string

The identifier of the principal requesting the list (must have 'read' permission).

b_id_farm

string

The identifier of the farm.

Returns

Promise<Principal[]>

A Promise that resolves to an array of Principal objects, each representing a principal associated with the farm.

Throws

If the acting principal does not have 'read' permission, or if any other error occurs during the operation.