File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ from invenio_curations.services.permissions import (
2020 CurationRDMRequestsPermissionPolicy,
2121)
2222from invenio_rdm_records.services.components import DefaultRecordsComponents
23+ from invenio_override.permissions import CustomCommunitiesPermissionPolicy
2324
2425def _(x): # needed to avoid start time failure with lazy strings
2526 return x
@@ -262,6 +263,22 @@ REQUESTS_PERMISSION_POLICY = CurationRDMRequestsPermissionPolicy
262263CURATIONS_ENABLE_REQUEST_COMMENTS = True
263264CURATIONS_COMMENT_TEMPLATE_FILE = " comment-template.html"
264265
266+ # ============================================================================
267+ # Invenio-Communities - Restrict Community Creation
268+ # ============================================================================
269+ OVERRIDE_COMMUNITIES_RESTRICT_CREATION = True
270+ " " " Restrict community creation to administrators.
271+
272+ When True: only admins can create communities.
273+ When False: any authenticated user can create communities.
274+ " " "
275+
276+ OVERRIDE_COMMUNITIES_CREATE_ROLES = [" community-creator" ]
277+ " " " Roles allowed to create communities when OVERRIDE_COMMUNITIES_RESTRICT_CREATION is True." " "
278+
279+ COMMUNITIES_PERMISSION_POLICY = CustomCommunitiesPermissionPolicy
280+ " " " Custom permission policy for communities." " "
281+
265282# ============================================================================
266283# Extras
267284# ============================================================================
You can’t perform that action at this time.
0 commit comments