admin/roles: view, archive and restore
This commit is contained in:
parent
8fa2fb7ddc
commit
d778380d8b
10 changed files with 363 additions and 2 deletions
|
|
@ -41,4 +41,23 @@ impl Role {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn get_by_name(
|
||||
conn: impl SqliteExecutor<'_>,
|
||||
name: &RoleID,
|
||||
) -> Result<Option<Self>, Error> {
|
||||
Ok(DatabaseRoles::get_one_by_name(conn, name.as_ref())
|
||||
.await?
|
||||
.map(Self::from))
|
||||
}
|
||||
|
||||
pub async fn set_archive_status(
|
||||
&self,
|
||||
conn: impl SqliteExecutor<'_>,
|
||||
value: bool,
|
||||
) -> Result<(), Error> {
|
||||
DatabaseRoles::set_archive_status(conn, self.name.as_ref(), value).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue