Implement poor man's admin panel

This commit is contained in:
Miroslav Prasil
2018-10-12 15:20:10 +01:00
parent ce4fedf191
commit a28caa33ef
12 changed files with 209 additions and 71 deletions

View File

@ -182,6 +182,13 @@ impl Cipher {
Ok(())
}
pub fn delete_all_by_user(user_uuid: &str, conn: &DbConn) -> QueryResult<()> {
for cipher in Self::find_owned_by_user(user_uuid, &conn) {
cipher.delete(&conn)?;
}
Ok(())
}
pub fn move_to_folder(&self, folder_uuid: Option<String>, user_uuid: &str, conn: &DbConn) -> Result<(), &str> {
match self.get_folder_uuid(&user_uuid, &conn) {
None => {