1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-23 07:52:23 +00:00

Add a line to describe superusers, remove useless roles in rights table

This commit is contained in:
Yohann D'ANELLO 2020-08-31 21:49:02 +02:00
parent 08c8792aed
commit ee26850e34
5 changed files with 41 additions and 29 deletions

View File

@ -2432,9 +2432,9 @@
"activity"
],
"query": "[\"AND\", {\"valid\": false}, {\"creater\": [\"user\"]}]",
"type": "organizer",
"type": "change",
"mask": 1,
"field": "name",
"field": "organizer",
"permanent": false,
"description": "Modifier l'organisateur d'une activité non validée dont on est l'auteur"
}
@ -2950,8 +2950,6 @@
55,
57,
52,
53,
54,
23,
24,
25,

View File

@ -3,11 +3,10 @@
import django_tables2 as tables
from django.contrib.auth.models import User
from django.db.models import Q
from django.urls import reverse_lazy
from django.utils.html import format_html
from django.utils.translation import gettext_lazy as _
from django_tables2 import A
from member.models import Membership
from note_kfet.middlewares import get_current_authenticated_user
from permission.backends import PermissionBackend
@ -37,7 +36,11 @@ class RightsTable(tables.Table):
def render_roles(self, record):
# If the user has the right to manage the roles, display the link to manage them
roles = record.roles.all()
roles = record.roles.filter((~(Q(name="Adhérent BDE")
| Q(name="Adhérent Kfet")
| Q(name="Membre de club")
| Q(name="Bureau de club"))
& Q(weirole__isnull=True))).all()
s = ", ".join(str(role) for role in roles)
if PermissionBackend.check_perm(get_current_authenticated_user(), "member.change_membership_roles", record):
s = format_html("<a href='" + str(reverse_lazy("member:club_manage_roles", kwargs={"pk": record.pk}))

View File

@ -13,6 +13,9 @@
{% trans "Users that have surnormal rights" %}
</h3>
<div class="card-body">
<div class="alert alert-info">
<i class="fas fa-info-circle"></i> {% trans "Superusers have all rights on everything, to manage the website." %}
</div>
<div class="card">
<div class="card-head">
<h4 class="card-header text-center">

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-31 21:07+0200\n"
"POT-Creation-Date: 2020-08-31 21:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -885,7 +885,7 @@ msgid "Add"
msgstr ""
#: apps/member/templates/member/club_detail.html:13
#: apps/permission/templates/permission/all_rights.html:30
#: apps/permission/templates/permission/all_rights.html:33
msgid "Club managers"
msgstr ""
@ -1567,7 +1567,7 @@ msgid ""
msgstr ""
#: apps/permission/models.py:183
#: apps/permission/templates/permission/all_rights.html:87
#: apps/permission/templates/permission/all_rights.html:90
msgid "permanent"
msgstr ""
@ -1616,35 +1616,39 @@ msgstr ""
msgid "Users that have surnormal rights"
msgstr ""
#: apps/permission/templates/permission/all_rights.html:19
#: apps/permission/templates/permission/all_rights.html:17
msgid "Superusers have all rights on everything, to manage the website."
msgstr ""
#: apps/permission/templates/permission/all_rights.html:22
msgid "Superusers"
msgstr ""
#: apps/permission/templates/permission/all_rights.html:43
#: apps/permission/templates/permission/all_rights.html:46
msgid "Roles description"
msgstr ""
#: apps/permission/templates/permission/all_rights.html:50
#: apps/permission/templates/permission/all_rights.html:53
msgid "Filter with roles that I have in at least one club"
msgstr ""
#: apps/permission/templates/permission/all_rights.html:67
#: apps/permission/templates/permission/all_rights.html:70
msgid "Owned"
msgstr ""
#: apps/permission/templates/permission/all_rights.html:78
#: apps/permission/templates/permission/all_rights.html:81
msgid "Own this role in the clubs"
msgstr ""
#: apps/permission/templates/permission/all_rights.html:84
#: apps/permission/templates/permission/all_rights.html:87
msgid "Mask:"
msgstr ""
#: apps/permission/templates/permission/all_rights.html:84
#: apps/permission/templates/permission/all_rights.html:87
msgid "Query:"
msgstr ""
#: apps/permission/templates/permission/all_rights.html:90
#: apps/permission/templates/permission/all_rights.html:93
msgid "No associated permission"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-31 21:07+0200\n"
"POT-Creation-Date: 2020-08-31 21:45+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -910,7 +910,7 @@ msgid "Add"
msgstr "Ajouter"
#: apps/member/templates/member/club_detail.html:13
#: apps/permission/templates/permission/all_rights.html:30
#: apps/permission/templates/permission/all_rights.html:33
msgid "Club managers"
msgstr "Bureau du club"
@ -1612,7 +1612,7 @@ msgstr ""
"l'utilisateur est expirée."
#: apps/permission/models.py:183
#: apps/permission/templates/permission/all_rights.html:87
#: apps/permission/templates/permission/all_rights.html:90
msgid "permanent"
msgstr "permanent"
@ -1669,35 +1669,39 @@ msgstr ""
msgid "Users that have surnormal rights"
msgstr "Liste des utilisateurs ayant des droits surnormaux"
#: apps/permission/templates/permission/all_rights.html:19
#: apps/permission/templates/permission/all_rights.html:17
msgid "Superusers have all rights on everything, to manage the website."
msgstr "Les super-utilisateurs ont tous les droits sur tout, afin de gérer le site."
#: apps/permission/templates/permission/all_rights.html:22
msgid "Superusers"
msgstr "Super-utilisateurs"
#: apps/permission/templates/permission/all_rights.html:43
#: apps/permission/templates/permission/all_rights.html:46
msgid "Roles description"
msgstr "Description de tous les rôles"
#: apps/permission/templates/permission/all_rights.html:50
#: apps/permission/templates/permission/all_rights.html:53
msgid "Filter with roles that I have in at least one club"
msgstr "Filtrer les rôles que je possède dans au moins un club"
#: apps/permission/templates/permission/all_rights.html:67
#: apps/permission/templates/permission/all_rights.html:70
msgid "Owned"
msgstr "Possédé"
#: apps/permission/templates/permission/all_rights.html:78
#: apps/permission/templates/permission/all_rights.html:81
msgid "Own this role in the clubs"
msgstr "Possède ce rôle dans les clubs"
#: apps/permission/templates/permission/all_rights.html:84
#: apps/permission/templates/permission/all_rights.html:87
msgid "Mask:"
msgstr "Masque :"
#: apps/permission/templates/permission/all_rights.html:84
#: apps/permission/templates/permission/all_rights.html:87
msgid "Query:"
msgstr "Requête :"
#: apps/permission/templates/permission/all_rights.html:90
#: apps/permission/templates/permission/all_rights.html:93
msgid "No associated permission"
msgstr "Pas de permission associée"