mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-11-05 06:38:37 +02: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:
1 parent
85adcf1ae5
commit
9f86196a9d
4 files changed
+54
-4
No files matched your search
@@ -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