feat(gpodder): add admin paginated users method

This commit is contained in:
Jef Roosens 2025-06-24 13:38:12 +02:00
parent 2524eb5807
commit 4854c84601
No known key found for this signature in database
GPG key ID: 21FD3D77D56BAF49
3 changed files with 23 additions and 1 deletions

View file

@ -1,7 +1,13 @@
use crate::models;
use crate::{AuthErr, Page, models};
/// Admin view of the repository, providing methods only allowed by admins
pub struct AdminRepository<'a> {
pub(crate) store: &'a (dyn super::GpodderStore + Send + Sync),
pub(crate) user: &'a models::User,
}
impl<'a> AdminRepository<'a> {
pub fn paginated_users(&self, page: Page) -> Result<Vec<models::User>, AuthErr> {
self.store.paginated_users(page)
}
}

View file

@ -64,6 +64,9 @@ pub trait GpodderAuthStore {
/// Remove any sessions whose last_seen timestamp is before the given minimum value
fn remove_old_sessions(&self, min_last_seen: DateTime<Utc>) -> Result<usize, AuthErr>;
/// Return the given page of users, ordered by username
fn paginated_users(&self, page: Page) -> Result<Vec<User>, AuthErr>;
}
pub trait GpodderDeviceStore {