feat(gpodder): add admin paginated users method
This commit is contained in:
parent
2524eb5807
commit
4854c84601
3 changed files with 23 additions and 1 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue