Write proper user permission code.

This commit is contained in:
Paul Makles
2021-01-09 16:50:11 +00:00
parent bb3667a83b
commit 5e70ceea01
9 changed files with 59 additions and 55 deletions

View File

@@ -9,7 +9,7 @@ pub async fn req(user: User, target: Ref) -> Result<JsonValue> {
if user.id != target.id {
// Check whether we are allowed to fetch this user.
let perm = crate::database::permissions::temp_calc_perm(&user, &target).await;
let perm = permissions::user::calculate(&user, &target.id).await;
if !perm.get_access() {
Err(Error::LabelMe)?
}