diff options
Diffstat (limited to 'src/git/authorization.rs')
| -rw-r--r-- | src/git/authorization.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/git/authorization.rs b/src/git/authorization.rs index 6b997d8..e7ea99b 100644 --- a/src/git/authorization.rs +++ b/src/git/authorization.rs | |||
| @@ -287,6 +287,20 @@ pub async fn fetch_repository_data( | |||
| 287 | }) | 287 | }) |
| 288 | } | 288 | } |
| 289 | 289 | ||
| 290 | pub fn pubkey_authorised_for_repo_owners( | ||
| 291 | pubkey: &PublicKey, | ||
| 292 | db_repo_data: &RepositoryData, | ||
| 293 | ) -> Vec<String> { | ||
| 294 | let mut repo_owners_authorising_pubkey = HashSet::new(); | ||
| 295 | let collections = collect_authorized_maintainers(&db_repo_data.announcements); | ||
| 296 | for (owner, authoised) in collections { | ||
| 297 | if authoised.contains(&pubkey.to_hex()) { | ||
| 298 | repo_owners_authorising_pubkey.insert(owner.to_string()); | ||
| 299 | } | ||
| 300 | } | ||
| 301 | repo_owners_authorising_pubkey.iter().cloned().collect() | ||
| 302 | } | ||
| 303 | |||
| 290 | /// Collect authorized maintainers grouped by owner from a set of announcements | 304 | /// Collect authorized maintainers grouped by owner from a set of announcements |
| 291 | /// | 305 | /// |
| 292 | /// For each announcement, returns a map from owner pubkey to authorized maintainers: | 306 | /// For each announcement, returns a map from owner pubkey to authorized maintainers: |