isDerogationGrantedForYear
@svenvw/fdm-source / fdm-core/src / isDerogationGrantedForYear
Function: isDerogationGrantedForYear()
isDerogationGrantedForYear(
fdm
,principal_id
,b_id_farm
,year
):Promise
<boolean
>
Defined in: fdm-core/src/derogation.ts:215
Checks if a derogation has been granted for a specific farm and year.
This function checks if the principal has 'read' permission on the farm.
Parameters
fdm
any
The FDM instance providing the connection to the database.
principal_id
any
The identifier of the principal making the request.
b_id_farm
any
The identifier of the farm.
year
number
The year to check for a derogation.
Returns
Promise
<boolean
>
A Promise that resolves to true if a derogation is granted for the specified year, false otherwise.
Throws
If the principal does not have permission to read the farm's derogations.