Minor fixes to orderings and permission serialization (#102)

* Fix latest_version in search results

* Handle users with invalid permissions instead of skipping them

* Specify order of some queries, fix serialization of permissions

* Run sqlx prepare
This commit is contained in:
Aeledfyr
2020-11-10 10:27:36 -06:00
committed by GitHub
parent 578d673a4e
commit da911bfeb8
7 changed files with 83 additions and 18 deletions

View File

@@ -22,6 +22,7 @@ pub struct Team {
bitflags::bitflags! {
#[derive(Serialize, Deserialize)]
#[serde(transparent)]
pub struct Permissions: u64 {
const UPLOAD_VERSION = 1 << 0;
const DELETE_VERSION = 1 << 1;
@@ -51,5 +52,5 @@ pub struct TeamMember {
/// The role of the user in the team
pub role: String,
/// A bitset containing the user's permissions in this team
pub permissions: Permissions,
pub permissions: Option<Permissions>,
}