Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/0.1.13'
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Nov 12, 2018
2 parents 58f14af + 6fe1b88 commit 048b2fc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.12
0.1.13
3 changes: 2 additions & 1 deletion edc_permissions/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from .group_names import (
ACCOUNT_MANAGER, ADMINISTRATION, PII_VIEW,
EVERYONE, AUDITOR, CLINIC, LAB, PHARMACY, PII,
EXPORT)
EXPORT, DATA_MANAGER)
from .lab_dashboard_codenames import LAB_DASHBOARD_CODENAMES

DEFAULT_AUDITOR_APP_LABELS = ['edc_lab', 'edc_offstudy']
Expand All @@ -12,6 +12,7 @@
ADMINISTRATION,
AUDITOR,
CLINIC,
DATA_MANAGER,
EVERYONE,
EXPORT,
LAB,
Expand Down
11 changes: 10 additions & 1 deletion edc_permissions/constants/default_codenames.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .group_names import (
ACCOUNT_MANAGER, ADMINISTRATION, PII_VIEW,
EVERYONE, AUDITOR, CLINIC, LAB, PHARMACY, PII,
EXPORT)
EXPORT, DATA_MANAGER)

DEFAULT_CODENAMES = {
ACCOUNT_MANAGER: [
Expand Down Expand Up @@ -93,6 +93,15 @@
'view_reference',
'view_subjectoffstudy',
],
DATA_MANAGER: [
'add_crfmetadata',
'add_requisitionmetadata',
'change_crfmetadata',
'change_requisitionmetadata',
'delete_crfmetadata',
'delete_requisitionmetadata',
'view_crfmetadata',
'view_requisitionmetadata'],
EVERYONE: [
'view_group',
'view_logentry',
Expand Down
1 change: 1 addition & 0 deletions edc_permissions/constants/group_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
ADMINISTRATION = 'ADMINISTRATION'
AUDITOR = 'AUDITOR'
CLINIC = 'CLINIC'
DATA_MANAGER = 'DATA_MANAGER'
EVERYONE = 'EVERYONE'
EXPORT = 'EXPORT'
LAB = 'LAB'
Expand Down
11 changes: 9 additions & 2 deletions edc_permissions/permissions_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
from edc_navbar.site_navbars import site_navbars

from .constants import (
ACCOUNT_MANAGER, ADMINISTRATION, EXPORT,
ACCOUNT_MANAGER, ADMINISTRATION, EXPORT, DATA_MANAGER,
EVERYONE, AUDITOR, CLINIC, LAB, PHARMACY, PII, PII_VIEW,
DEFAULT_GROUP_NAMES, DEFAULT_PII_MODELS,
DEFAULT_AUDITOR_APP_LABELS, LAB_DASHBOARD_CODENAMES)


DUPLICATE_CODENAME = 'duplicate_codename'


Expand Down Expand Up @@ -414,6 +413,14 @@ def update_administration_group_permissions(self):
self.add_navbar_permissions(
group, codenames=self.navbar_codenames.get(ADMINISTRATION))

def update_data_manager_group_permissions(self):
group_name = DATA_MANAGER
group = Group.objects.get(name=group_name)
group.permissions.clear()
for permission in Permission.objects.filter(
content_type__app_label__in=['edc_metadata', ]):
group.permissions.add(permission)

def add_pii_permissions(self, group, view_only=None):
"""Adds PII model permissions.
"""
Expand Down

0 comments on commit 048b2fc

Please sign in to comment.