* fix: getTeamIdsWithPermission * fix get bookings handler for pbac and fallback roles * add tests * fix fallback roll query * push integration test fixes * Check for pbac features * fix * restore role behaviour * fix fallabck roles no pbac enabled * debug: add logging to investigate PBAC query failures Co-Authored-By: sean@cal.com <Sean@brydon.io> * re-write integration tests * fix: use >= comparison with bigint cast for PBAC permission count Co-Authored-By: sean@cal.com <Sean@brydon.io> * Restore permission repo * re-write from scratch * fix tests + file * imrpove perf by makign CTE and moving to left join * fix org scoped taems * clean up * fix: update PermissionCheckService mock to use function instead of arrow function Co-Authored-By: sean@cal.com <Sean@brydon.io> * refactor: rename scopedOrgId to orgId Co-Authored-By: sean@cal.com <Sean@brydon.io> * refactor: use MembershipRole enum instead of hardcoded strings Co-Authored-By: sean@cal.com <Sean@brydon.io> --------- Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com> Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Eunjae Lee <hey@eunjae.dev> Co-authored-by: Benny Joo <sldisek783@gmail.com>