Netflix / hubcommander

A Slack bot for GitHub organization management -- and other things too
Apache License 2.0
1.28k stars 156 forks source link

Exclude org employees from using addcollab #110

Closed SwampDragons closed 2 years ago

SwampDragons commented 2 years ago

If an employee is already a member of an org, don't allow them to get set as an outside collaborator as well.

This works by allowing you to set a list of teams per org in the config.py that we can check against for team membership. If a user tries to call addcollab for an org but is already a member of any of the listed teams for that org, then the bot will error. This is useful for preventing duplicate, conflicting roles for a user.

It is also opt-in; if you don't set any teams in the new "collab_validation_teams" setting, then AddCollab will continue to work as it did before.