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:
parent
6a99849a1e
commit
b2fc0499f6
6 changed files with 42 additions and 138 deletions
10
src/auth.rs
10
src/auth.rs
|
@ -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{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue