More cipher optimization/cleanup

This commit is contained in:
Jeremy Lin
2020-07-03 10:49:10 -07:00
parent 35868dd72c
commit f9a73a9bbe
2 changed files with 22 additions and 33 deletions

View File

@@ -393,8 +393,13 @@ impl UserOrganization {
Ok(())
}
pub fn has_status(self, status: UserOrgStatus) -> bool {
self.status == status as i32
}
pub fn has_full_access(self) -> bool {
self.access_all || self.atype >= UserOrgType::Admin
(self.access_all || self.atype >= UserOrgType::Admin) &&
self.has_status(UserOrgStatus::Confirmed)
}
pub fn find_by_uuid(uuid: &str, conn: &DbConn) -> Option<Self> {