1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-06-13 14:20:07 +00:00

Add support for adding and viewing of org ciphers

This commit is contained in:
Miroslav Prasil 2018-04-27 12:49:34 +01:00
parent 9c46d2f72d
commit 7e9e200d29
4 changed files with 30 additions and 12 deletions

View file

@ -96,7 +96,7 @@ impl Cipher {
"RevisionDate": format_date(&self.updated_at),
"FolderId": self.folder_uuid,
"Favorite": self.favorite,
"OrganizationId": "",
"OrganizationId": self.organization_uuid,
"Attachments": attachments_json,
"OrganizationUseTotp": false,
@ -154,6 +154,12 @@ impl Cipher {
.load::<Self>(&**conn).expect("Error loading ciphers")
}
pub fn find_by_org(org_uuid: &str, conn: &DbConn) -> Vec<Self> {
ciphers::table
.filter(ciphers::organization_uuid.eq(org_uuid))
.load::<Self>(&**conn).expect("Error loading ciphers")
}
pub fn find_by_folder(folder_uuid: &str, conn: &DbConn) -> Vec<Self> {
ciphers::table
.filter(ciphers::folder_uuid.eq(folder_uuid))