|
3 | 3 | # This file is part of Invenio.
|
4 | 4 | # Copyright (C) 2016-2024 CERN.
|
5 | 5 | # Copyright (C) 2023 Graz University of Technology.
|
| 6 | +# Copyright (C) 2024 KTH Royal Institute of Technology. |
6 | 7 | #
|
7 | 8 | # Invenio is free software; you can redistribute it and/or modify it
|
8 | 9 | # under the terms of the MIT License; see LICENSE file for more details.
|
@@ -432,14 +433,27 @@ def communities_settings_submission_policy(pid_value, community, community_ui):
|
432 | 433 | if not permissions["can_update"]:
|
433 | 434 | raise PermissionDeniedError()
|
434 | 435 |
|
| 436 | + if current_app.config.get("RDM_COMMUNITY_REQUIRED_TO_PUBLISH", False): |
| 437 | + # Restrict review policies when publishing with community is required |
| 438 | + available_review_policies = [ |
| 439 | + { |
| 440 | + "text": "Review all submissions", |
| 441 | + "value": "closed", |
| 442 | + "icon": "lock", |
| 443 | + "helpText": _("All submissions to the community must be reviewed."), |
| 444 | + } |
| 445 | + ] |
| 446 | + else: |
| 447 | + available_review_policies = REVIEW_POLICY_FIELDS |
| 448 | + |
435 | 449 | return render_community_theme_template(
|
436 | 450 | "invenio_communities/details/settings/submission_policy.html",
|
437 | 451 | theme=community_ui.get("theme", {}),
|
438 | 452 | community=community_ui,
|
439 | 453 | permissions=permissions,
|
440 | 454 | form_config=dict(
|
441 | 455 | access=dict(
|
442 |
| - review_policy=REVIEW_POLICY_FIELDS, |
| 456 | + review_policy=available_review_policies, |
443 | 457 | record_submission_policy=RECORDS_SUBMISSION_POLICY_FIELDS,
|
444 | 458 | ),
|
445 | 459 | ),
|
|
0 commit comments