Add per-user folder-cipher mapping

This commit is contained in:
Miroslav Prasil
2018-04-30 10:52:15 +01:00
parent f578019df6
commit 514a372bc8
11 changed files with 217 additions and 49 deletions

View File

@@ -222,10 +222,10 @@ impl UserOrganization {
.first::<Self>(&**conn).ok()
}
pub fn find_by_user(user_uuid: &str, conn: &DbConn) -> Vec<Self> {
pub fn find_by_user(user_uuid: &str, conn: &DbConn) -> Option<Vec<Self>> {
users_organizations::table
.filter(users_organizations::user_uuid.eq(user_uuid))
.load::<Self>(&**conn).expect("Error loading user organizations")
.load::<Self>(&**conn).ok()
}
pub fn find_by_org(org_uuid: &str, conn: &DbConn) -> Vec<Self> {