Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

legacy: add old deposit scopes #572

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 29 additions & 34 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions site/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ invenio_celery.tasks =
zenodo_rdm_sitemap = zenodo_rdm.sitemap.tasks
zenodo_rdm_openaire = zenodo_rdm.openaire.tasks
zenodo_stats = zenodo_rdm.stats.tasks
invenio_oauth2server.scopes =
deposit_write_scope = zenodo_rdm.legacy.scopes:deposit_write_scope
deposit_actions_scope = zenodo_rdm.legacy.scopes:deposit_actions_scope

invenio_assets.webpack =
zenodo_rdm_theme = zenodo_rdm.webpack:theme
Expand Down
25 changes: 25 additions & 0 deletions site/zenodo_rdm/legacy/scopes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2023 CERN.
#
# Zenodo is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.

"""OAuth2 legacy token scopes."""

from invenio_i18n import lazy_gettext as _
from invenio_oauth2server.models import Scope

deposit_write_scope = Scope(
id_="deposit:write",
group="deposit",
help_text=_("Allow upload (but not publishing)."),
)
"""Allow upload (but not publishing)."""

deposit_actions_scope = Scope(
id_="deposit:actions",
group="deposit",
help_text=_("Allow publishing of uploads."),
)
"""Allow publishing of uploads."""
Loading