diff --git a/config/settings/base.py b/config/settings/base.py index 8e80aca6..4821ea98 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -370,14 +370,14 @@ ANVIL_API_SERVICE_ACCOUNT_FILE = env("ANVIL_API_SERVICE_ACCOUNT_FILE") # Specify workspace adapters. ANVIL_WORKSPACE_ADAPTERS = [ - "primed.miscellaneous_workspaces.adapters.TemplateWorkspaceAdapter", "primed.dbgap.adapters.dbGaPWorkspaceAdapter", "primed.cdsa.adapters.CDSAWorkspaceAdapter", + "primed.miscellaneous_workspaces.adapters.OpenAccessWorkspaceAdapter", + "primed.miscellaneous_workspaces.adapters.SimulatedDataWorkspaceAdapter", + "primed.miscellaneous_workspaces.adapters.ResourceWorkspaceAdapter", "primed.miscellaneous_workspaces.adapters.ConsortiumDevelWorkspaceAdapter", + "primed.miscellaneous_workspaces.adapters.TemplateWorkspaceAdapter", "primed.miscellaneous_workspaces.adapters.DataPrepWorkspaceAdapter", - "primed.miscellaneous_workspaces.adapters.ResourceWorkspaceAdapter", - "primed.miscellaneous_workspaces.adapters.SimulatedDataWorkspaceAdapter", - "primed.miscellaneous_workspaces.adapters.OpenAccessWorkspaceAdapter", ] ANVIL_ACCOUNT_ADAPTER = "primed.primed_anvil.adapters.AccountAdapter" diff --git a/primed/cdsa/adapters.py b/primed/cdsa/adapters.py index ea87a984..e4409ddd 100644 --- a/primed/cdsa/adapters.py +++ b/primed/cdsa/adapters.py @@ -10,9 +10,10 @@ class CDSAWorkspaceAdapter(BaseWorkspaceAdapter): type = "cdsa" name = "CDSA workspace" description = ( - "Workspaces containing data from the Consortium Data Sharing Agreement." + "Workspaces containing data from the Consortium Data Sharing Agreement" ) - list_table_class = tables.CDSAWorkspaceTable + list_table_class_staff_view = tables.CDSAWorkspaceStaffTable + list_table_class_view = tables.CDSAWorkspaceUserTable workspace_form_class = WorkspaceForm workspace_data_model = models.CDSAWorkspace workspace_data_form_class = forms.CDSAWorkspaceForm diff --git a/primed/cdsa/tables.py b/primed/cdsa/tables.py index 66b734da..3646f915 100644 --- a/primed/cdsa/tables.py +++ b/primed/cdsa/tables.py @@ -295,7 +295,7 @@ def render_date_shared(self, record): return "—" -class CDSAWorkspaceTable(tables.Table): +class CDSAWorkspaceStaffTable(tables.Table): """A table for the CDSAWorkspace model.""" name = tables.Column(linkify=True) @@ -324,10 +324,10 @@ class Meta: order_by = ("name",) -class CDSAWorkspaceLimitedViewTable(tables.Table): +class CDSAWorkspaceUserTable(tables.Table): """A table for the CDSAWorkspace model.""" - name = tables.Column() + name = tables.Column(linkify=True) billing_project = tables.Column() cdsaworkspace__data_use_permission__abbreviation = tables.Column( verbose_name="DUO permission", diff --git a/primed/cdsa/tests/test_tables.py b/primed/cdsa/tests/test_tables.py index 82b7b7dc..c7c8c9de 100644 --- a/primed/cdsa/tests/test_tables.py +++ b/primed/cdsa/tests/test_tables.py @@ -447,12 +447,12 @@ def test_ordering(self): self.assertEqual(table.data[1], instance_1) -class CDSAWorkspaceTableTest(TestCase): - """Tests for the CDSAWorkspaceTable class.""" +class CDSAWorkspaceStaffTableTest(TestCase): + """Tests for the CDSAWorkspaceStaffTable class.""" model = Workspace model_factory = factories.CDSAWorkspaceFactory - table_class = tables.CDSAWorkspaceTable + table_class = tables.CDSAWorkspaceStaffTable def test_row_count_with_no_objects(self): table = self.table_class(self.model.objects.all()) @@ -477,12 +477,12 @@ def test_ordering(self): self.assertEqual(table.data[1], instance_1.workspace) -class CDSAWorkspaceLimitedViewTableTest(TestCase): - """Tests for the CDSAWorkspaceLimitedViewTable class.""" +class CDSAWorkspaceUserTableTest(TestCase): + """Tests for the CDSAWorkspaceUserTable class.""" model = Workspace model_factory = factories.CDSAWorkspaceFactory - table_class = tables.CDSAWorkspaceLimitedViewTable + table_class = tables.CDSAWorkspaceUserTable def test_row_count_with_no_objects(self): table = self.table_class(self.model.objects.all()) diff --git a/primed/dbgap/adapters.py b/primed/dbgap/adapters.py index 532b0cfe..5c567a5b 100644 --- a/primed/dbgap/adapters.py +++ b/primed/dbgap/adapters.py @@ -10,7 +10,8 @@ class dbGaPWorkspaceAdapter(BaseWorkspaceAdapter): type = "dbgap" name = "dbGaP workspace" description = "Workspaces containing data from released dbGaP accessions" - list_table_class = tables.dbGaPWorkspaceTable + list_table_class_staff_view = tables.dbGaPWorkspaceStaffTable + list_table_class_view = tables.dbGaPWorkspaceUserTable workspace_form_class = WorkspaceForm workspace_data_model = models.dbGaPWorkspace workspace_data_form_class = forms.dbGaPWorkspaceForm diff --git a/primed/dbgap/tables.py b/primed/dbgap/tables.py index 2e075bcd..3d23b07c 100644 --- a/primed/dbgap/tables.py +++ b/primed/dbgap/tables.py @@ -71,7 +71,7 @@ def render_dbgap_phs(self, value): return "phs{0:06d}".format(value) -class dbGaPWorkspaceTable(tables.Table): +class dbGaPWorkspaceStaffTable(tables.Table): """Class to render a table of Workspace objects with dbGaPWorkspace workspace data.""" name = tables.columns.Column(linkify=True) @@ -116,10 +116,10 @@ def render_number_approved_dars(self, record): return n -class dbGaPWorkspaceLimitedViewTable(tables.Table): +class dbGaPWorkspaceUserTable(tables.Table): """Class to render a table of Workspace objects with dbGaPWorkspace workspace data.""" - name = tables.columns.Column() + name = tables.columns.Column(linkify=True) billing_project = tables.Column() dbgap_accession = dbGaPAccessionColumn( accessor="dbgapworkspace__get_dbgap_accession", diff --git a/primed/dbgap/tests/test_tables.py b/primed/dbgap/tests/test_tables.py index 6db0ae99..514a27fd 100644 --- a/primed/dbgap/tests/test_tables.py +++ b/primed/dbgap/tests/test_tables.py @@ -116,10 +116,10 @@ def test_ordering(self): self.assertEqual(table.data[1], instance_1) -class dbGaPWorkspaceTableTest(TestCase): +class dbGaPWorkspaceStaffTableTest(TestCase): model = acm_models.Workspace model_factory = factories.dbGaPWorkspaceFactory - table_class = tables.dbGaPWorkspaceTable + table_class = tables.dbGaPWorkspaceStaffTable def test_row_count_with_no_objects(self): table = self.table_class(self.model.objects.all()) @@ -206,10 +206,10 @@ def test_render_number_approved_dars_only_most_recent(self): # self.assertEqual("", table.rows[0].get_cell_value("is_shared")) -class dbGaPWorkspaceLimitedViewTableTest(TestCase): +class dbGaPWorkspaceUserTableTest(TestCase): model = acm_models.Workspace model_factory = factories.dbGaPWorkspaceFactory - table_class = tables.dbGaPWorkspaceTable + table_class = tables.dbGaPWorkspaceStaffTable def test_row_count_with_no_objects(self): table = self.table_class(self.model.objects.all()) diff --git a/primed/dbgap/tests/test_views.py b/primed/dbgap/tests/test_views.py index 1791ca41..3a98876f 100644 --- a/primed/dbgap/tests/test_views.py +++ b/primed/dbgap/tests/test_views.py @@ -267,7 +267,7 @@ def test_workspace_table(self): response = self.get_view()(request, dbgap_phs=self.obj.dbgap_phs) self.assertIn("workspace_table", response.context_data) self.assertIsInstance( - response.context_data["workspace_table"], tables.dbGaPWorkspaceTable + response.context_data["workspace_table"], tables.dbGaPWorkspaceStaffTable ) def test_workspace_table_none(self): @@ -856,7 +856,7 @@ def test_view_has_correct_table_class(self): response = self.get_view()(request, workspace_type=self.workspace_type) self.assertIn("table", response.context_data) self.assertIsInstance( - response.context_data["table"], tables.dbGaPWorkspaceTable + response.context_data["table"], tables.dbGaPWorkspaceStaffTable ) diff --git a/primed/dbgap/views.py b/primed/dbgap/views.py index 545830b4..082f7a7b 100644 --- a/primed/dbgap/views.py +++ b/primed/dbgap/views.py @@ -57,7 +57,7 @@ def get_object(self, queryset=None): return obj def get_table(self): - return tables.dbGaPWorkspaceTable( + return tables.dbGaPWorkspaceStaffTable( Workspace.objects.filter(dbgapworkspace__dbgap_study_accession=self.object), exclude=( "dbgapworkspace__dbgap_study_accession__study", diff --git a/primed/duo/tests/test_views.py b/primed/duo/tests/test_views.py index 5ebd2bc6..96f2a5af 100644 --- a/primed/duo/tests/test_views.py +++ b/primed/duo/tests/test_views.py @@ -19,7 +19,7 @@ class DataUsePermissionListTest(TestCase): def setUp(self): """Set up test class.""" self.factory = RequestFactory() - # Create a user with both view and edit permission. + # Create a user with staff view permission. self.user = UserFactory.create(username="test", password="test") self.user.user_permissions.add( Permission.objects.get( @@ -122,11 +122,11 @@ class DataUsePermissionDetailTest(TestCase): def setUp(self): """Set up test class.""" self.factory = RequestFactory() - # Create a user with both view and edit permission. + # Create a user with view permission. self.user = UserFactory.create(username="test", password="test") self.user.user_permissions.add( Permission.objects.get( - codename=AnVILProjectManagerAccess.STAFF_VIEW_PERMISSION_CODENAME + codename=AnVILProjectManagerAccess.VIEW_PERMISSION_CODENAME ) ) @@ -282,7 +282,7 @@ def setUp(self): self.user = UserFactory.create(username="test", password="test") self.user.user_permissions.add( Permission.objects.get( - codename=AnVILProjectManagerAccess.STAFF_VIEW_PERMISSION_CODENAME + codename=AnVILProjectManagerAccess.VIEW_PERMISSION_CODENAME ) ) diff --git a/primed/duo/views.py b/primed/duo/views.py index 06c7c749..f27c1e25 100644 --- a/primed/duo/views.py +++ b/primed/duo/views.py @@ -1,4 +1,7 @@ -from anvil_consortium_manager.auth import AnVILConsortiumManagerStaffViewRequired +from anvil_consortium_manager.auth import ( + AnVILConsortiumManagerStaffViewRequired, + AnVILConsortiumManagerViewRequired, +) from django.http import Http404 from django.views.generic import DetailView, ListView @@ -18,7 +21,7 @@ def get_context_data(self, **kwargs): return context -class DataUsePermissionDetail(AnVILConsortiumManagerStaffViewRequired, DetailView): +class DataUsePermissionDetail(AnVILConsortiumManagerViewRequired, DetailView): model = models.DataUsePermission @@ -51,7 +54,7 @@ def get_context_data(self, **kwargs): return context -class DataUseModifierDetail(AnVILConsortiumManagerStaffViewRequired, DetailView): +class DataUseModifierDetail(AnVILConsortiumManagerViewRequired, DetailView): model = models.DataUseModifier diff --git a/primed/miscellaneous_workspaces/adapters.py b/primed/miscellaneous_workspaces/adapters.py index d4c9e8e8..24262017 100644 --- a/primed/miscellaneous_workspaces/adapters.py +++ b/primed/miscellaneous_workspaces/adapters.py @@ -3,7 +3,10 @@ from anvil_consortium_manager.adapters.workspace import BaseWorkspaceAdapter from anvil_consortium_manager.forms import WorkspaceForm -from primed.primed_anvil.tables import DefaultWorkspaceTable +from primed.primed_anvil.tables import ( + DefaultWorkspaceStaffTable, + DefaultWorkspaceUserTable, +) from . import forms, models, tables @@ -14,7 +17,8 @@ class SimulatedDataWorkspaceAdapter(BaseWorkspaceAdapter): type = "simulated_data" name = "Simulated Data workspace" description = "Workspaces containing simulated data" - list_table_class = DefaultWorkspaceTable + list_table_class_staff_view = DefaultWorkspaceStaffTable + list_table_class_view = DefaultWorkspaceUserTable workspace_form_class = WorkspaceForm workspace_data_model = models.SimulatedDataWorkspace workspace_data_form_class = forms.SimulatedDataWorkspaceForm @@ -29,7 +33,8 @@ class ConsortiumDevelWorkspaceAdapter(BaseWorkspaceAdapter): type = "devel" name = "Consortium development workspace" description = "Workspaces intended for consortium development of methods" - list_table_class = DefaultWorkspaceTable + list_table_class_staff_view = DefaultWorkspaceStaffTable + list_table_class_view = DefaultWorkspaceUserTable workspace_form_class = WorkspaceForm workspace_data_model = models.ConsortiumDevelWorkspace workspace_data_form_class = forms.ConsortiumDevelWorkspaceForm @@ -42,7 +47,8 @@ class ResourceWorkspaceAdapter(BaseWorkspaceAdapter): type = "resource" name = "Resource workspace" description = "Workspaces containing consortium resources (e.g., examples of using AnVIL, data inventories)" - list_table_class = DefaultWorkspaceTable + list_table_class_staff_view = DefaultWorkspaceStaffTable + list_table_class_view = DefaultWorkspaceUserTable workspace_form_class = WorkspaceForm workspace_data_model = models.ResourceWorkspace workspace_data_form_class = forms.ResourceWorkspaceForm @@ -54,8 +60,11 @@ class TemplateWorkspaceAdapter(BaseWorkspaceAdapter): type = "template" name = "Template workspace" - description = "Template workspaces that can be cloned to create other workspaces" - list_table_class = DefaultWorkspaceTable + description = ( + "Template workspaces that will be cloned by the CC to create other workspaces" + ) + list_table_class_staff_view = DefaultWorkspaceStaffTable + list_table_class_view = DefaultWorkspaceUserTable workspace_form_class = WorkspaceForm workspace_data_model = models.TemplateWorkspace workspace_data_form_class = forms.TemplateWorkspaceForm @@ -68,7 +77,8 @@ class OpenAccessWorkspaceAdapter(BaseWorkspaceAdapter): type = "open_access" name = "Open access workspace" description = "Workspaces containing open access data" - list_table_class = tables.OpenAccessWorkspaceTable + list_table_class_staff_view = tables.OpenAccessWorkspaceStaffTable + list_table_class_view = tables.OpenAccessWorkspaceUserTable workspace_form_class = WorkspaceForm workspace_data_model = models.OpenAccessWorkspace workspace_data_form_class = forms.OpenAccessWorkspaceForm @@ -82,8 +92,9 @@ class DataPrepWorkspaceAdapter(BaseWorkspaceAdapter): type = "data_prep" name = "Data prep workspace" - description = "Workspaces used to prepare data." - list_table_class = tables.DataPrepWorkspaceTable + description = "Workspaces used to prepare data for sharing or update data that is already shared" + list_table_class_staff_view = tables.DataPrepWorkspaceTable + list_table_class_view = tables.DataPrepWorkspaceTable workspace_form_class = WorkspaceForm workspace_data_model = models.DataPrepWorkspace workspace_data_form_class = forms.DataPrepWorkspaceForm diff --git a/primed/miscellaneous_workspaces/tables.py b/primed/miscellaneous_workspaces/tables.py index f9763621..fd1132df 100644 --- a/primed/miscellaneous_workspaces/tables.py +++ b/primed/miscellaneous_workspaces/tables.py @@ -9,7 +9,7 @@ ) -class OpenAccessWorkspaceTable(tables.Table): +class OpenAccessWorkspaceStaffTable(tables.Table): """Class to render a table of Workspace objects with OpenAccessWorkspace workspace data.""" name = tables.columns.Column(linkify=True) @@ -27,10 +27,10 @@ class Meta: order_by = ("name",) -class OpenAccessWorkspaceLimitedViewTable(tables.Table): +class OpenAccessWorkspaceUserTable(tables.Table): """Class to render a table of Workspace objects with OpenAccessWorkspace workspace data.""" - name = tables.columns.Column() + name = tables.columns.Column(linkify=True) billing_project = tables.Column() is_shared = WorkspaceSharedWithConsortiumColumn() diff --git a/primed/miscellaneous_workspaces/tests/test_tables.py b/primed/miscellaneous_workspaces/tests/test_tables.py index 992ffcb3..de536164 100644 --- a/primed/miscellaneous_workspaces/tests/test_tables.py +++ b/primed/miscellaneous_workspaces/tests/test_tables.py @@ -7,11 +7,11 @@ from . import factories -class OpenAccessWorkspaceTableTest(TestCase): - """Tests for the OpenAccessWorkspaceTable table.""" +class OpenAccessWorkspaceStaffTableTest(TestCase): + """Tests for the OpenAccessWorkspaceStaffTable table.""" model_factory = factories.OpenAccessWorkspaceFactory - table_class = tables.OpenAccessWorkspaceTable + table_class = tables.OpenAccessWorkspaceStaffTable def test_row_count_with_no_objects(self): table = self.table_class(Workspace.objects.all()) @@ -28,11 +28,11 @@ def test_row_count_with_two_objects(self): self.assertEqual(len(table.rows), 2) -class OpenAccessWorkspaceLimitedViewTableTest(TestCase): - """Tests for the OpenAccessWorkspaceTable table.""" +class OpenAccessWorkspaceUserTableTest(TestCase): + """Tests for the OpenAccessWorkspaceStaffTable table.""" model_factory = factories.OpenAccessWorkspaceFactory - table_class = tables.OpenAccessWorkspaceLimitedViewTable + table_class = tables.OpenAccessWorkspaceUserTable def test_row_count_with_no_objects(self): table = self.table_class(Workspace.objects.all()) diff --git a/primed/primed_anvil/tables.py b/primed/primed_anvil/tables.py index 05e680bf..71fb7fac 100644 --- a/primed/primed_anvil/tables.py +++ b/primed/primed_anvil/tables.py @@ -47,31 +47,7 @@ def _get_bool_value(self, record, value, bound_column): return is_shared -# class WorkspaceSharedWithConsortiumTable(tables.Table): -# """Table including a column to indicate if a workspace is shared with PRIMED_ALL.""" - -# is_shared = tables.columns.Column( -# accessor="pk", -# verbose_name="Shared with PRIMED?", -# orderable=False, -# ) - -# def render_is_shared(self, record): -# is_shared = record.workspacegroupsharing_set.filter( -# group__name="PRIMED_ALL" -# ).exists() -# if is_shared: -# icon = "check-circle-fill" -# color = "green" -# value = format_html( -# """""".format(icon, color) -# ) -# else: -# value = "" -# return value - - -class DefaultWorkspaceTable(tables.Table): +class DefaultWorkspaceStaffTable(tables.Table): """Class to use for default workspace tables in PRIMED.""" name = tables.Column(linkify=True, verbose_name="Workspace") @@ -95,6 +71,23 @@ class Meta: order_by = ("name",) +class DefaultWorkspaceUserTable(tables.Table): + """Class to use for default workspace tables in PRIMED.""" + + name = tables.Column(linkify=True, verbose_name="Workspace") + billing_project = tables.Column() + is_shared = WorkspaceSharedWithConsortiumColumn() + + class Meta: + model = Workspace + fields = ( + "name", + "billing_project", + "is_shared", + ) + order_by = ("name",) + + class StudyTable(tables.Table): """A table for `Study`s.""" diff --git a/primed/primed_anvil/tests/test_views.py b/primed/primed_anvil/tests/test_views.py index 85d59706..b84d4c5f 100644 --- a/primed/primed_anvil/tests/test_views.py +++ b/primed/primed_anvil/tests/test_views.py @@ -12,21 +12,21 @@ from django.test import RequestFactory, TestCase from django.urls import reverse -from primed.cdsa.tables import CDSAWorkspaceLimitedViewTable, CDSAWorkspaceTable +from primed.cdsa.tables import CDSAWorkspaceStaffTable, CDSAWorkspaceUserTable from primed.cdsa.tests.factories import ( CDSAWorkspaceFactory, DataAffiliateAgreementFactory, MemberAgreementFactory, ) -from primed.dbgap.tables import dbGaPWorkspaceLimitedViewTable, dbGaPWorkspaceTable +from primed.dbgap.tables import dbGaPWorkspaceStaffTable, dbGaPWorkspaceUserTable from primed.dbgap.tests.factories import ( dbGaPApplicationFactory, dbGaPStudyAccessionFactory, dbGaPWorkspaceFactory, ) from primed.miscellaneous_workspaces.tables import ( - OpenAccessWorkspaceLimitedViewTable, - OpenAccessWorkspaceTable, + OpenAccessWorkspaceStaffTable, + OpenAccessWorkspaceUserTable, ) from primed.miscellaneous_workspaces.tests.factories import OpenAccessWorkspaceFactory from primed.primed_anvil.tests.factories import AvailableDataFactory, StudyFactory @@ -257,10 +257,14 @@ def test_table_classes_view_permission(self): self.client.force_login(self.user) response = self.client.get(self.get_url(obj.pk)) self.assertIn("tables", response.context_data) - self.assertIsInstance(response.context_data["tables"][0], dbGaPWorkspaceTable) - self.assertIsInstance(response.context_data["tables"][1], CDSAWorkspaceTable) self.assertIsInstance( - response.context_data["tables"][3], OpenAccessWorkspaceTable + response.context_data["tables"][0], dbGaPWorkspaceStaffTable + ) + self.assertIsInstance( + response.context_data["tables"][1], CDSAWorkspaceStaffTable + ) + self.assertIsInstance( + response.context_data["tables"][3], OpenAccessWorkspaceStaffTable ) def test_table_classes_limited_view_permission(self): @@ -276,13 +280,13 @@ def test_table_classes_limited_view_permission(self): response = self.client.get(self.get_url(obj.pk)) self.assertIn("tables", response.context_data) self.assertIsInstance( - response.context_data["tables"][0], dbGaPWorkspaceLimitedViewTable + response.context_data["tables"][0], dbGaPWorkspaceUserTable ) self.assertIsInstance( - response.context_data["tables"][1], CDSAWorkspaceLimitedViewTable + response.context_data["tables"][1], CDSAWorkspaceUserTable ) self.assertIsInstance( - response.context_data["tables"][3], OpenAccessWorkspaceLimitedViewTable + response.context_data["tables"][3], OpenAccessWorkspaceUserTable ) def test_dbgap_workspace_table(self): diff --git a/primed/primed_anvil/views.py b/primed/primed_anvil/views.py index b4fdb98b..09b0d672 100644 --- a/primed/primed_anvil/views.py +++ b/primed/primed_anvil/views.py @@ -15,20 +15,20 @@ from primed.cdsa.models import DataAffiliateAgreement, MemberAgreement from primed.cdsa.tables import ( - CDSAWorkspaceLimitedViewTable, - CDSAWorkspaceTable, + CDSAWorkspaceStaffTable, + CDSAWorkspaceUserTable, DataAffiliateAgreementTable, MemberAgreementTable, ) from primed.dbgap.models import dbGaPApplication from primed.dbgap.tables import ( dbGaPApplicationTable, - dbGaPWorkspaceLimitedViewTable, - dbGaPWorkspaceTable, + dbGaPWorkspaceStaffTable, + dbGaPWorkspaceUserTable, ) from primed.miscellaneous_workspaces.tables import ( - OpenAccessWorkspaceLimitedViewTable, - OpenAccessWorkspaceTable, + OpenAccessWorkspaceStaffTable, + OpenAccessWorkspaceUserTable, ) from primed.users.tables import UserTable @@ -42,12 +42,12 @@ class StudyDetail(AnVILConsortiumManagerViewRequired, MultiTableMixin, DetailVie model = models.Study tables = [ - dbGaPWorkspaceTable, - CDSAWorkspaceTable, + dbGaPWorkspaceStaffTable, + CDSAWorkspaceStaffTable, DataAffiliateAgreementTable, - OpenAccessWorkspaceTable, + OpenAccessWorkspaceStaffTable, ] - # table_class = dbGaPWorkspaceTable + # table_class = dbGaPWorkspaceStaffTable # context_table_name = "dbgap_workspace_table" def get_tables(self): @@ -64,18 +64,18 @@ def get_tables(self): full_view_perm = f"{apm_content_type.app_label}.{AnVILProjectManagerAccess.STAFF_VIEW_PERMISSION_CODENAME}" if self.request.user.has_perm(full_view_perm): return ( - dbGaPWorkspaceTable(dbgap_qs), - CDSAWorkspaceTable(cdsa_qs), + dbGaPWorkspaceStaffTable(dbgap_qs), + CDSAWorkspaceStaffTable(cdsa_qs), DataAffiliateAgreementTable(agreement_qs), - OpenAccessWorkspaceTable(open_access_qs), + OpenAccessWorkspaceStaffTable(open_access_qs), ) else: # Assume they have limited view due to auth mixin. return ( - dbGaPWorkspaceLimitedViewTable(dbgap_qs), - CDSAWorkspaceLimitedViewTable(cdsa_qs), + dbGaPWorkspaceUserTable(dbgap_qs), + CDSAWorkspaceUserTable(cdsa_qs), DataAffiliateAgreementTable(agreement_qs), - OpenAccessWorkspaceLimitedViewTable(open_access_qs), + OpenAccessWorkspaceUserTable(open_access_qs), ) @@ -168,7 +168,7 @@ class AvailableDataDetail( model = models.AvailableData context_table_name = "dbgap_workspace_table" - table_class = dbGaPWorkspaceTable + table_class = dbGaPWorkspaceStaffTable context_table_name = "dbgap_workspace_table" def get_table_data(self): diff --git a/primed/templates/base.html b/primed/templates/base.html index c6b0a9aa..b25b6cd1 100644 --- a/primed/templates/base.html +++ b/primed/templates/base.html @@ -118,8 +118,15 @@ {% endfor %} {% endif %} - {% block content %} + {% if not request.user.account %} + + {% endif %} + + {% block content %}