-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Creates a new `subdivisions` resource. * Links subdivisions to documents. * Links subdivision to users. * Links subdivision to deposits in diffusion step. * Creates a subdivision when a section is found in RERO DOC publication. * Configures a facet to filter deposits by subdivisions. * Configures a facet to filter users by subdivision. * Configures a facet to filter documents by subdivision. * Updates permissions for collections by adding rules for subdivisions. * Updates permissions for deposits by adding rules for subdivisions. * Updates permissions for documents by adding rules for subdivisions. * Adds organisations and subdivisions info in document detail view below the title. * Translates subdivisions and collections facets. * Makes the name of a subdivision or collection unique per language. * Closes #145. Co-Authored-by: Sébastien Délèze <[email protected]>
- Loading branch information
Sébastien Délèze
committed
Aug 23, 2021
1 parent
a393585
commit 0d45c81
Showing
61 changed files
with
2,059 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Swiss Open Access Repository | ||
# Copyright (C) 2021 RERO | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, version 3 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
"""Deposits JSON schema class.""" | ||
|
||
from sonar.modules.users.api import current_user_record | ||
|
||
from .json_schema_base import JSONSchemaBase | ||
|
||
|
||
class DepositsJSONSchema(JSONSchemaBase): | ||
"""JSON schema for deposits.""" | ||
|
||
def process(self): | ||
"""Document JSON schema custom process. | ||
:returns: The processed schema. | ||
""" | ||
schema = super().process() | ||
|
||
if current_user_record.is_moderator: | ||
return schema | ||
|
||
schema['properties']['diffusion']['properties'].pop( | ||
'subdivisions', None) | ||
|
||
return schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.