Skip to content

Commit

Permalink
Merge pull request #6759 from hotosm/fastapi-refactor
Browse files Browse the repository at this point in the history
Filter by only active team members in project action permission
  • Loading branch information
prabinoid authored Feb 21, 2025
2 parents 386106b + 65de7ca commit 905fb29
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions backend/services/project_search_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@ async def filter_by_user_permission(user, permission: str):
FROM team_members tm
JOIN project_teams pt ON tm.team_id = pt.team_id
WHERE tm.user_id = :user_id
AND tm.active = True
AND pt.role = ANY(:team_roles)
)
{ "AND p." + permission + f" = {permission_class.TEAMS.value}" if user.mapping_level == MappingLevel.BEGINNER.value else "" }
Expand Down

0 comments on commit 905fb29

Please sign in to comment.