Skip to content

Commit

Permalink
views: add permission check for creating a new deposit
Browse files Browse the repository at this point in the history
  • Loading branch information
anikachurilova authored and ntarocco committed Apr 11, 2024
1 parent 5968c6c commit c2e950c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions invenio_app_rdm/records_ui/views/deposits.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,12 @@ def new_record():
@pass_draft_community
def deposit_create(community=None):
"""Create a new deposit."""
can_create = current_rdm_records.records_service.check_permission(
g.identity, "create"
)
if not can_create:
raise PermissionDeniedError()

community_theme = None
if community is not None:
community_theme = community.get("theme", {})
Expand Down

0 comments on commit c2e950c

Please sign in to comment.