Struct cargo_registry::owner::Team
[−]
[src]
pub struct Team { pub id: i32, pub login: String, pub github_id: i32, pub name: Option<String>, pub avatar: Option<String>, }
For now, just a Github Team. Can be upgraded to other teams later if desirable.
Fields
id: i32
Unique table id
login: String
"github:org:team" An opaque unique ID, that was at one point parsed out to query Github. We only query membership with github using the github_id, though. This is the only name we should ever talk to Cargo about.
github_id: i32
We're assuming these are stable
name: Option<String>
Sugary goodness
avatar: Option<String>
Methods
impl Team
[src]
fn create(
app: &App,
conn: &PgConnection,
login: &str,
req_user: &User
) -> CargoResult<Self>
[src]
app: &App,
conn: &PgConnection,
login: &str,
req_user: &User
) -> CargoResult<Self>
Tries to create the Team in the DB (assumes a :
has already been found).
fn create_github_team(
app: &App,
conn: &PgConnection,
login: &str,
org_name: &str,
team_name: &str,
req_user: &User
) -> CargoResult<Self>
[src]
app: &App,
conn: &PgConnection,
login: &str,
org_name: &str,
team_name: &str,
req_user: &User
) -> CargoResult<Self>
Tries to create a Github Team from scratch. Assumes org
and team
are
correctly parsed out of the full name
. name
is passed as a
convenience to avoid rebuilding it.
fn contains_user(&self, app: &App, user: &User) -> CargoResult<bool>
[src]
Phones home to Github to ask if this User is a member of the given team. Note that we're assuming that the given user is the one interested in the answer. If this is not the case, then we could accidentally leak private membership information here.