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

Fam Zheng famz at redhat.com
Thu Mar 8 07:49:47 UTC 2018


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 at 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 at redhat.com>




More information about the Patchew-devel mailing list