diff --git a/invenio.cfg b/invenio.cfg index 1bd1f1f5..1ee1baf8 100644 --- a/invenio.cfg +++ b/invenio.cfg @@ -515,6 +515,17 @@ CDS_COMMITTEE_APPROVAL_COMMUNITIES = { "counter_digits": 3, # zero-padding width, e.g. 3 → "001" }, }, + "1c46ceab-af68-4502-a436-cdf5a4cfbbe0": { + # isolde + "read_only": True, # only allow read-only access to this community + "label": "EP approval", + "referee_group": "cds-ph-ep-publication", + "report_number": { + "prefix": "CERN-EP", + "include_year": True, + "counter_digits": 3, + }, + }, } # # CDS_COMMITTEE_APPROVAL_COMMUNITIES = { diff --git a/site/cds_rdm/requests/committee_approval.py b/site/cds_rdm/requests/committee_approval.py index dbe994c6..ee2154c2 100644 --- a/site/cds_rdm/requests/committee_approval.py +++ b/site/cds_rdm/requests/committee_approval.py @@ -71,7 +71,13 @@ def _resolve_community_config(request): "CDS_COMMITTEE_APPROVAL_COMMUNITIES", {} ) if default_community_id in committee_communities: - return committee_communities[default_community_id] + config = committee_communities[default_community_id] + if config.get("read_only"): + raise ValidationError( + "This community's approval workflow is read-only. " + "No new committee approval requests can be submitted." + ) + return config raise ValidationError( # TODO: do we need i18n for these errors? "The record's community is not enrolled in the committee approval workflow. " diff --git a/site/cds_rdm/requests/committee_approval_state.py b/site/cds_rdm/requests/committee_approval_state.py index db6fc409..76a966d9 100644 --- a/site/cds_rdm/requests/committee_approval_state.py +++ b/site/cds_rdm/requests/committee_approval_state.py @@ -222,9 +222,31 @@ def get_committee_approval_state(record_ui, record=None): pass open_request = _get_open_request(record_id, parent_record) - can_submit = _check_can_manage_community(community_id) approved_report_number = ea.get("reportnumber") - can_create_public = _check_can_create_public(can_submit, ea, record_id) + + community_read_only = community_config.get("read_only", False) + if community_read_only: + if not approved_report_number: + return { + "can_submit": False, + "can_create_public": False, + "approval_label": _approval_label(community_config), + "committee_name": _committee_name(community_config), + "community_enrolled": False, + "is_public_approved_record": False, + "open_request": None, + "approved_report_number": None, + "approval_date": None, + "committee_approval": {}, + "draft_record_id": None, + "can_view_reviewed_version": False, + "receiver_group": None, + } + can_submit = False + can_create_public = False + else: + can_submit = _check_can_manage_community(community_id) + can_create_public = _check_can_create_public(can_submit, ea, record_id) cern_scientific_community_id = current_app.config.get( "CDS_CERN_SCIENTIFIC_COMMUNITY_ID"