Re-structure Permissions; add perm to view users from mutual groups.

This commit is contained in:
Paul Makles
2021-01-26 21:12:23 +00:00
parent 23ec2d61f1
commit f42480886b
17 changed files with 210 additions and 58 deletions

View File

@@ -9,7 +9,9 @@ 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 = permissions::user::calculate(&user, &target.id).await;
let perm = permissions::PermissionCalculator::new(&user)
.with_user(&target)
.for_user_given().await?;
if !perm.get_access() {
Err(Error::LabelMe)?
}