-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from IT-CEREBRUM/CRB-3996-greg-import-setting
CRB-3996: GREG_IMPORT setting
- Loading branch information
Showing
8 changed files
with
140 additions
and
58 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2023 University of Oslo, Norway | ||
# | ||
# This file is part of Cerebrum. | ||
# | ||
# Cerebrum is free software; you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# Cerebrum 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 | ||
# General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with Cerebrum; if not, write to the Free Software Foundation, | ||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | ||
""" | ||
UiO-specific Greg import logic. | ||
""" | ||
from Cerebrum.group.template import GroupTemplate | ||
from Cerebrum.modules.greg import mapper | ||
from Cerebrum.modules.greg import importer | ||
from Cerebrum.modules.import_utils.groups import GroupMembershipSetter | ||
|
||
|
||
GREG_CONSENT_GROUP = GroupTemplate( | ||
group_name='greg-aktivt-samtykke', | ||
group_description='Guests who consents to electronic publication', | ||
group_type='internal-group', | ||
group_visibility='A', | ||
) | ||
|
||
sync_greg_consent = GroupMembershipSetter(GREG_CONSENT_GROUP) | ||
|
||
|
||
class UioGregMapper(mapper.GregMapper): | ||
pass | ||
|
||
|
||
class UioGregImporter(importer.GregImporter): | ||
|
||
CONSENT_GROUPS = { | ||
'greg-publish': sync_greg_consent, | ||
} | ||
|
||
mapper = UioGregMapper() |
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.