vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit 990c83a03751a0296c2f8ab64c844dc3da1fc306
parent 9eaa9c1a17a2ee32655e2ac4868e775cd57976c7
Author: Daniel GarcĂ­a <dani-garcia@users.noreply.github.com>
Date:   Mon,  1 Oct 2018 17:40:14 +0200

Merge pull request #204 from mprasil/org_improvements

Org improvements
Diffstat:
Msrc/api/core/ciphers.rs | 10+++-------
Msrc/db/models/organization.rs | 5+++--
Msrc/main.rs | 1+
3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/api/core/ciphers.rs b/src/api/core/ciphers.rs @@ -430,16 +430,12 @@ fn share_cipher_by_uuid(uuid: &str, data: ShareCipherData, headers: &Headers, co Some(organization_uuid) => { let mut shared_to_collection = false; for uuid in &data.CollectionIds { - match Collection::find_by_uuid(uuid, &conn) { + match Collection::find_by_uuid_and_org(uuid, &organization_uuid, &conn) { None => err!("Invalid collection ID provided"), Some(collection) => { if collection.is_writable_by_user(&headers.user.uuid, &conn) { - if collection.org_uuid == organization_uuid { - CollectionCipher::save(&cipher.uuid.clone(), &collection.uuid, &conn); - shared_to_collection = true; - } else { - err!("Collection does not belong to organization") - } + CollectionCipher::save(&cipher.uuid.clone(), &collection.uuid, &conn); + shared_to_collection = true; } else { err!("No rights to modify the collection") } diff --git a/src/db/models/organization.rs b/src/db/models/organization.rs @@ -66,7 +66,7 @@ impl Organization { "Name": self.name, "Seats": 10, "MaxCollections": 10, - + "MaxStorageGb": 10, // The value doesn't matter, we don't check server-side "Use2fa": true, "UseDirectory": false, "UseEvents": false, @@ -83,7 +83,7 @@ impl Organization { "BillingEmail": self.billing_email, "Plan": "TeamsAnnually", "PlanType": 5, // TeamsAnnually plan - + "UsersGetPremium": true, "Object": "organization", }) } @@ -158,6 +158,7 @@ impl UserOrganization { "Name": org.name, "Seats": 10, "MaxCollections": 10, + "UsersGetPremium": true, "Use2fa": true, "UseDirectory": false, diff --git a/src/main.rs b/src/main.rs @@ -1,5 +1,6 @@ #![feature(plugin, custom_derive, vec_remove_item, try_trait)] #![plugin(rocket_codegen)] +#![recursion_limit="128"] #![allow(proc_macro_derive_resolution_fallback)] // TODO: Remove this when diesel update fixes warnings extern crate rocket; extern crate rocket_contrib;