isUserAllowedToReleaseAmount
constisUserAllowedToReleaseAmount: (releaseUser,requestedAmount) =>boolean
Checks if the given releaseUser is allowed to release the given amount.
- It looks for the release employee file of the releaseUser.
- If no release employee file is found, it returns
false. - If a employee file is found, it looks for a temporal release role.
- If a temporal release role is active, it uses the temporal release role. If a date-range is provided, it checks if the current date is between the date-range.
- It looks for the release role.
- If no release role is found, it returns
false. - If a release role is found, it checks if the requested amount is greater than the release amount of the release role.
- If the requested amount is greater than the release amount of the release role, it returns
falseotherwise ittrue.
Parameters
releaseUser
string
The release user for which the amount should be released
requestedAmount
number
The amount that should be released
Returns
boolean
true if the release user is allowed to release the amount, otherwise false