acl: Add PartialEq for the structs

This commit is contained in:
George Kaklamanos 2023-11-20 20:52:22 +02:00
parent f1294480b0
commit c3cc8a2bd5
No known key found for this signature in database
GPG key ID: C0CAB8A6BDC9399D

View file

@ -1,6 +1,6 @@
use serde_derive::Deserialize;
#[derive(Deserialize, Debug)]
#[derive(Deserialize, PartialEq, Debug)]
pub struct ACLEntry {
pub username: String,
pub resource: String,
@ -20,6 +20,20 @@ pub struct ResourceShortcuts {
pub id: i8,
}
impl PartialEq for AuthMethod {
fn eq(&self, other: &Self) -> bool{
(self.method == other.method)
&& (self.identifier == other.identifier)
}
}
impl PartialEq for ResourceShortcuts {
fn eq(&self, other: &Self) -> bool{
(self.username == other.username)
&& (self.id == other.id)
}
}
pub trait ACL {
/// `Option`s on delete operations mean that all associated data is removed
/// ACLEntry