fix: check can_del

This commit is contained in:
2022-03-22 03:04:46 +08:00
parent c9659acd6e
commit 49d871157d

View File

@@ -85,7 +85,7 @@ async fn p2output(p: &Post, user: &CurrentUser, db: &Db, rconn: RdsConn) -> Post
None None
} }
}, },
can_del: user.is_admin || p.author_hash == user.namehash, can_del: p.check_permission(user, "wd").is_ok(),
attention: Attention::init(&user.namehash, rconn.clone()) attention: Attention::init(&user.namehash, rconn.clone())
.has(p.id) .has(p.id)
.await .await