diff --git a/scipost_django/profiles/templates/profiles/_profile_card.html b/scipost_django/profiles/templates/profiles/_profile_card.html index ef028444e964a25297e53f11716391bb8b0f34b2..c721561e11c114d0b1a13cbf35db43ae941c1e39 100644 --- a/scipost_django/profiles/templates/profiles/_profile_card.html +++ b/scipost_django/profiles/templates/profiles/_profile_card.html @@ -19,7 +19,9 @@ <tr> <td>Affiliations <ul> - <li><a href="{% url 'profiles:affiliation_create' profile_id=profile.id %}">Add a new Affiliation</a></li> + {% if perms.scipost.can_add_profile_affiliations %} + <li><a href="{% url 'profiles:affiliation_create' profile_id=profile.id %}">Add a new Affiliation</a></li> + {% endif %} </ul> </td> <td> diff --git a/scipost_django/scipost/management/commands/add_groups_and_permissions.py b/scipost_django/scipost/management/commands/add_groups_and_permissions.py index fc3fd32483f3376e779297d570ef589a1024c51c..4bad7bd01eccf8dfeb653a0b2ce8e14ed460e38f 100644 --- a/scipost_django/scipost/management/commands/add_groups_and_permissions.py +++ b/scipost_django/scipost/management/commands/add_groups_and_permissions.py @@ -119,6 +119,11 @@ class Command(BaseCommand): ) # Profile Management + can_add_profile_affiliations, created = Permission.objects.get_or_create( + codename="can_add_profile_affiliations", + name="Can add affiliations to Profiles", + content_type=content_type, + ) can_merge_profiles, created = Permission.objects.get_or_create( codename="can_merge_profiles", name="Can merge Profiles", @@ -463,6 +468,7 @@ class Command(BaseCommand): can_view_statistics, can_create_profiles, can_view_profiles, + can_add_profile_affiliations, can_merge_profiles, can_merge_contributors, can_manage_ontology, @@ -526,6 +532,7 @@ class Command(BaseCommand): can_view_statistics, can_create_profiles, can_view_profiles, + can_add_profile_affiliations, can_merge_profiles, can_merge_contributors, can_manage_ontology, @@ -544,6 +551,7 @@ class Command(BaseCommand): can_take_charge_of_submissions, can_create_profiles, can_view_profiles, + can_add_profile_affiliations, can_attend_VGMs, can_view_statistics, can_manage_ontology, @@ -614,6 +622,7 @@ class Command(BaseCommand): ProductionSupervisors.permissions.set( [ can_view_profiles, + can_add_profile_affiliations, can_assign_production_officer, can_take_decisions_related_to_proofs, # can_draft_publication,