1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-08-02 00:59:08 +00:00

Finish invite functionality, and remove virtual organization

This commit is contained in:
Daniel García 2018-12-19 22:51:08 +01:00
commit b2fc0499f6
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
6 changed files with 42 additions and 138 deletions

View file

@ -131,7 +131,7 @@ use rocket::Outcome;
use rocket::request::{self, Request, FromRequest};
use crate::db::DbConn;
use crate::db::models::{User, Organization, UserOrganization, UserOrgType, UserOrgStatus, Device};
use crate::db::models::{User, UserOrganization, UserOrgType, UserOrgStatus, Device};
pub struct Headers {
pub host: String,
@ -245,13 +245,7 @@ impl<'a, 'r> FromRequest<'a, 'r> for OrgHeaders {
err_handler!("The current user isn't confirmed member of the organization")
}
}
None => {
if headers.user.is_server_admin() && org_id == Organization::VIRTUAL_ID {
UserOrganization::new_virtual(headers.user.uuid.clone(), UserOrgType::Owner, UserOrgStatus::Confirmed)
} else {
err_handler!("The current user isn't member of the organization")
}
}
None => err_handler!("The current user isn't member of the organization")
};
Outcome::Success(Self{