mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-11 03:05:58 +03:00
Add support for the Personal Ownership policy
Upstream refs: * https://github.com/bitwarden/server/pull/1013 * https://bitwarden.com/help/article/policies/#personal-ownership
This commit is contained in:
@@ -412,11 +412,15 @@ impl UserOrganization {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn has_status(self, status: UserOrgStatus) -> bool {
|
||||
pub fn has_status(&self, status: UserOrgStatus) -> bool {
|
||||
self.status == status as i32
|
||||
}
|
||||
|
||||
pub fn has_full_access(self) -> bool {
|
||||
pub fn has_type(&self, user_type: UserOrgType) -> bool {
|
||||
self.atype == user_type as i32
|
||||
}
|
||||
|
||||
pub fn has_full_access(&self) -> bool {
|
||||
(self.access_all || self.atype >= UserOrgType::Admin) &&
|
||||
self.has_status(UserOrgStatus::Confirmed)
|
||||
}
|
||||
|
Reference in New Issue
Block a user