Extract project roles predicate mapping into a new function