I have the method below that takes an array of strings. I want to be able to return true if the user has any of the array string passed.
How can I achieve that?
const hasAnyPermission = (permissionsPassed: string[]) => {
if (user?.permissionsEnabled === false) {
return true
}
//permissions below is an array of strings
return permissions.includes(permissionsPassed)
}
Mapor aSetto check if it includes permissionPassed. code would be like so :permissionsPassed.some(permission => permissions.has(permission))