#460 [frontend] warn maintainer when working in foreign project
Merged 5 years ago by msuchy. Opened 5 years ago by frostyx.
copr/ frostyx/copr warn-server-admin  into  master

@@ -567,3 +567,13 @@ 

          {% endfor %}

        </div>

  {% endmacro %}

+ 

+ {% macro warn_server_admin(copr) %}

+   {% if g.user and g.user.admin and g.user != copr.user %}

+     {% if not g.user.permissions_for_copr(copr) or g.user.permissions_for_copr(copr).copr_admin < 2 %}

+       {% set msg = "As a maintainer of this Copr instance, you have permissions to modify this project,

+                     but if you are acting as a regular user now, be aware that this is not your project." %}

+       {{ alert(msg, type="warning") }}

+     {% endif %}

+   {% endif %}

+ {% endmacro %}

@@ -1,5 +1,5 @@ 

  {% extends "coprs/detail.html" %}

- {% from "_helpers.html" import copr_name %}

+ {% from "_helpers.html" import copr_name, warn_server_admin %}

  {% block title %}Settings {{ copr_name(copr) }}{% endblock %}

  

  {% set selected_tab = "settings" %}
@@ -28,6 +28,8 @@ 

  

  {% block detail_body %}

  

+ {{ warn_server_admin(copr) }}

+ 

  <ul class="nav nav-tabs nav-tabs-pf">

  

  

As Copr maintainers, we have a possibility to modify settings of other peoples projects.
However, most of the time, we act as regular users, so it can be done mistakenly. Therefore I want to add this little warning.

As Copr maintainers, we have a possibility to modify settings of other peoples projects.
However, most of the time, we act as regular users, so it can be done mistakenly. Therefore I want to add this little warning.

Such nice description should be added into git-log message first (oagure just goes and C&P'es it into first PR comment). Otherwise +1.

rebased onto bb59d01

5 years ago

Such nice description should be added into git-log message first (oagure just goes and C&P'es it into first PR comment).

Good point. I've rebased it and added the description directly to the commit.

Pull-Request has been merged by msuchy

5 years ago