add: apps api
This commit is contained in:
parent
2a99d49c8a
commit
ebded00fd3
33 changed files with 698 additions and 31 deletions
|
@ -403,6 +403,14 @@ impl User {
|
|||
self.stripe_id = String::new();
|
||||
self.connections = HashMap::new();
|
||||
}
|
||||
|
||||
/// Get a grant from the user given the grant's `app` ID.
|
||||
///
|
||||
/// Should be used **before** adding another grant (to ensure the app doesn't
|
||||
/// already have a grant for this user).
|
||||
pub fn get_grant_by_app_id(&self, id: usize) -> Option<&AuthGrant> {
|
||||
self.grants.iter().find(|x| x.app == id)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue