[Patchew-devel] [PATCH] git: show admin link to staff users only

Paolo Bonzini posted 1 patch 6 years, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/patchew-ci tags/patchew/20180308064126.17240-2-pbonzini@redhat.com
www/templates/base.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Patchew-devel] [PATCH] git: show admin link to staff users only
Posted by Paolo Bonzini 6 years, 4 months ago
While superusers automatically get all permissions, they do not have access
to the admin---that is reserved to "staff" users.  Fix that.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 www/templates/base.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/templates/base.html b/www/templates/base.html
index 225474f..89dabcf 100644
--- a/www/templates/base.html
+++ b/www/templates/base.html
@@ -74,7 +74,7 @@ crossorigin="anonymous"/>
                     Hi {{ user.username }} <span class="caret"></span>
                 </button>
                 <ul class="dropdown-menu">
-                    {% if request.user.is_superuser %}
+                    {% if request.user.is_staff %}
                     <li><a href="/admin" target="blank">Admin</a></li>
                     {% endif %}
                     <li role="separator" class="divider"></li>
-- 
2.14.3

_______________________________________________
Patchew-devel mailing list
Patchew-devel@redhat.com
https://www.redhat.com/mailman/listinfo/patchew-devel
Re: [Patchew-devel] [PATCH] git: show admin link to staff users only
Posted by Fam Zheng 6 years, 4 months ago
On Thu, 03/08 07:41, Paolo Bonzini wrote:
> While superusers automatically get all permissions, they do not have access
> to the admin---that is reserved to "staff" users.  Fix that.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  www/templates/base.html | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/www/templates/base.html b/www/templates/base.html
> index 225474f..89dabcf 100644
> --- a/www/templates/base.html
> +++ b/www/templates/base.html
> @@ -74,7 +74,7 @@ crossorigin="anonymous"/>
>                      Hi {{ user.username }} <span class="caret"></span>
>                  </button>
>                  <ul class="dropdown-menu">
> -                    {% if request.user.is_superuser %}
> +                    {% if request.user.is_staff %}
>                      <li><a href="/admin" target="blank">Admin</a></li>
>                      {% endif %}
>                      <li role="separator" class="divider"></li>

Reviewed-by: Fam Zheng <famz@redhat.com>

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