[Patchew-devel] [PATCH] git: require maintainership to edit configuration

Paolo Bonzini posted 1 patch 6 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/patchew-ci tags/patchew/20180308075143.18626-1-pbonzini@redhat.com
mods/git.py | 2 ++
1 file changed, 2 insertions(+)
[Patchew-devel] [PATCH] git: require maintainership to edit configuration
Posted by Paolo Bonzini 6 years, 1 month ago
git info must not be visible without authentication.  Use maintained_by
as in other prepare_project_hook

Fixes: f845f6359ae939d72c40db46710d676755944b0a
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 mods/git.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mods/git.py b/mods/git.py
index df4185a..cda42dd 100644
--- a/mods/git.py
+++ b/mods/git.py
@@ -193,6 +193,8 @@ class GitModule(PatchewModule):
                                          })
 
     def prepare_project_hook(self, request, project):
+        if not project.maintained_by(request.user):
+            return
         project.extra_info.append({"title": "Git configuration",
                                    "class": "info",
                                    "content_html": self.build_config_html(request,
-- 
2.14.3

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel
Re: [Patchew-devel] [PATCH] git: require maintainership to edit configuration
Posted by Fam Zheng 6 years, 1 month ago
On Thu, Mar 8, 2018 at 3:51 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> git info must not be visible without authentication.  Use maintained_by
> as in other prepare_project_hook
>
> Fixes: f845f6359ae939d72c40db46710d676755944b0a
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  mods/git.py | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/mods/git.py b/mods/git.py
> index df4185a..cda42dd 100644
> --- a/mods/git.py
> +++ b/mods/git.py
> @@ -193,6 +193,8 @@ class GitModule(PatchewModule):
>                                           })
>
>      def prepare_project_hook(self, request, project):
> +        if not project.maintained_by(request.user):
> +            return
>          project.extra_info.append({"title": "Git configuration",
>                                     "class": "info",
>                                     "content_html": self.build_config_html(request,


Applied, thanks.

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel