developmentseed / osm-teams

Teams for OpenStreetMap!
https://mapping.team
MIT License
26 stars 5 forks source link

Filter teams in list to exclude teams a user can't access #47

Open sethvincent opened 5 years ago

sethvincent commented 5 years ago

We should have something similar to the team:view permission on this endpoint that filters out teams that a user can not view.

https://github.com/developmentseed/osm-teams/blob/aa513d70d3e63df77e909ecccb25f21acca05823/app/manage/teams.js#L5-L20

kamicut commented 5 years ago

I think this is handled not at the endpoint level but at the database level. The request from the database should be something like:

listteams = (public teams + private teams that can be accessed by user ) filtered by osmId if it exists

sethvincent commented 5 years ago

Yeah, that makes sense for it to be at the database level.