@@ -2,9 +2,6 @@ use bon::Builder;
22use diesel:: prelude:: * ;
33use diesel_async:: { AsyncPgConnection , RunQueryDsl } ;
44
5- use crates_io_github:: { GitHubClient , GitHubError } ;
6- use oauth2:: AccessToken ;
7-
85use crate :: models:: { Crate , CrateOwner , Owner , OwnerKind } ;
96use crate :: schema:: { crate_owners, teams} ;
107
@@ -54,22 +51,6 @@ impl NewTeam<'_> {
5451}
5552
5653impl Team {
57- /// Phones home to Github to ask if this User is a member of the given team.
58- /// Note that we're assuming that the given user is the one interested in
59- /// the answer. If this is not the case, then we could accidentally leak
60- /// private membership information here.
61- pub async fn contains_user (
62- & self ,
63- gh_client : & dyn GitHubClient ,
64- gh_login : & str ,
65- token : & AccessToken ,
66- ) -> Result < bool , GitHubError > {
67- Ok ( gh_client
68- . team_membership ( self . org_id , self . github_id , gh_login, token)
69- . await ?
70- . is_some_and ( |m| m. is_active ( ) ) )
71- }
72-
7354 pub async fn owning ( krate : & Crate , conn : & mut AsyncPgConnection ) -> QueryResult < Vec < Owner > > {
7455 let base_query = CrateOwner :: belonging_to ( krate) . filter ( crate_owners:: deleted. eq ( false ) ) ;
7556 let teams = base_query
0 commit comments