From 38cb7de13a6d543e2c1bbdbd8dab077654fe552e Mon Sep 17 00:00:00 2001 From: Bill Burdick Date: Mon, 3 Oct 2022 10:33:53 +0300 Subject: [PATCH 1/2] cleanup --- src/webui/gitutils.jl | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/webui/gitutils.jl b/src/webui/gitutils.jl index 250538d89e..2774081879 100644 --- a/src/webui/gitutils.jl +++ b/src/webui/gitutils.jl @@ -115,17 +115,14 @@ function isauthorized(u::User{GitLab.User}, repo::GitLab.Project, fetch = true) end # Same as above: group membership then collaborator check. nspath = split(repo.namespace.full_path, "/") - ismember = @gf_bool @mock is_collaborator(u.forge, repo.namespace.full_path, repo.name, u.user.id) - if !ismember - accns = "" - for ns in nspath - accns = joinpath(accns, ns) - ismember = @gf_bool @mock is_member(forge, accns, u.user.id) - ismember && - break - end + (@gf_bool @mock is_collaborator(u.forge, repo.namespace.full_path, repo.name, u.user.id)) && + return AuthSuccess() + accns = "" + for ns in nspath + accns = joinpath(accns, ns) + (@gf_bool @mock is_member(forge, accns, u.user.id)) && + return AuthSuccess() end - ismember && return AuthSuccess() AuthFailure("Project $(repo.name) belongs to the group $(repo.namespace.full_path), and user $(u.user.name) is not a member of that group or its parent group(s)") end From fbc662174c28e96c5cc170ef782236c422953ad4 Mon Sep 17 00:00:00 2001 From: Bill Burdick Date: Mon, 3 Oct 2022 10:36:06 +0300 Subject: [PATCH 2/2] update to version 1.5 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index edc0cd04eb..627fdcecfa 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Registrator" uuid = "4418983a-e44d-11e8-3aec-9789530b3b3e" authors = ["Stefan Karpinski "] -version = "1.4.2" +version = "1.5" [deps] AutoHashEquals = "15f4f7f2-30c1-5605-9d31-71845cf9641f"