forked from jmug/stoatchat
Label permission errors, and too many ids for /stale.
This commit is contained in:
@@ -13,7 +13,7 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
|
||||
.await?;
|
||||
|
||||
if !perm.get_access() {
|
||||
Err(Error::LabelMe)?
|
||||
Err(Error::MissingPermission)?
|
||||
}
|
||||
|
||||
Ok(json!(target.from(&user).with(perm)))
|
||||
|
||||
@@ -12,8 +12,8 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
|
||||
.find(
|
||||
doc! {
|
||||
"$and": [
|
||||
{ "relations.id": &user.id },
|
||||
{ "relations.id": &target.id }
|
||||
{ "relations._id": &user.id },
|
||||
{ "relations._id": &target.id }
|
||||
]
|
||||
},
|
||||
FindOptions::builder().projection(doc! { "_id": 1 }).build(),
|
||||
|
||||
Reference in New Issue
Block a user