From e8cf20110599c16df4f8a33ee36c3fe282cefa3a Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Thu, 30 Jul 2020 20:36:49 +0200 Subject: perm staff for non primary group --- accounts/templates/accounts/index.html | 19 +---- client/migrations/0002_auto_20200730_1951.py | 22 ++++++ client/models.py | 3 +- server/templates/server/doc_list.html | 2 +- server/templates/server/doc_type.html | 2 +- server/templates/server/index.html | 6 ++ server/templates/server/user_list.html | 2 +- server/views.py | 109 ++++++++++++++++++++------- templates/registration/base.html | 2 +- templates/registration/base_client.html | 2 +- 10 files changed, 117 insertions(+), 52 deletions(-) create mode 100644 client/migrations/0002_auto_20200730_1951.py diff --git a/accounts/templates/accounts/index.html b/accounts/templates/accounts/index.html index e0674a7..7f1f449 100644 --- a/accounts/templates/accounts/index.html +++ b/accounts/templates/accounts/index.html @@ -8,7 +8,7 @@ Home Account - - {% endblock%} {% block content %} diff --git a/client/migrations/0002_auto_20200730_1951.py b/client/migrations/0002_auto_20200730_1951.py new file mode 100644 index 0000000..3644e42 --- /dev/null +++ b/client/migrations/0002_auto_20200730_1951.py @@ -0,0 +1,22 @@ +# Generated by Django 3.0.7 on 2020-07-30 17:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('client', '0001_squashed_0026_document_signed_doc'), + ] + + operations = [ + migrations.AlterModelOptions( + name='document', + options={'permissions': [('approved', 'The user is approved'), ('staff', 'The user is staff of the non primary group')]}, + ), + migrations.AlterField( + model_name='document', + name='compilation_date', + field=models.DateTimeField(auto_now_add=True), + ), + ] diff --git a/client/models.py b/client/models.py index 7c47cee..5d59e3e 100644 --- a/client/models.py +++ b/client/models.py @@ -75,7 +75,8 @@ class Document(models.Model): class Meta: permissions = [ - ("approved", "The user is approved") + ("approved", "The user is approved"), + ("staff", "The user is staff of the non primary group") ] diff --git a/server/templates/server/doc_list.html b/server/templates/server/doc_list.html index 12b64cd..302a1d9 100644 --- a/server/templates/server/doc_list.html +++ b/server/templates/server/doc_list.html @@ -9,7 +9,7 @@ Admin Documenti