Skip to content
Snippets Groups Projects
Commit bcf230a4 authored by Alexander Purr's avatar Alexander Purr Committed by Dorian Merz
Browse files

refs #18223 [fid_bbi] add new user groups

* user group translations
* add list of user permissions
* add new job titles to forms
* set default permissions based on job title
parent 4bbf9232
Branches
Tags
No related merge requests found
...@@ -3,3 +3,10 @@ relative_path = ../../../fid/config/vufind/fid.ini ...@@ -3,3 +3,10 @@ relative_path = ../../../fid/config/vufind/fid.ini
[Client] [Client]
baseUrl = https://fid-api.finc.info/staging/bbi baseUrl = https://fid-api.finc.info/staging/bbi
[Admin]
; List of all available user permissions
permission_options[] = 'basic_access'
permission_options[] = 'limited_access'
permission_options[] = 'extended_access'
permission_options[] = 'full_access'
\ No newline at end of file
<?php
/**
* Copyright (C) 2020 Leipzig University Library
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* @author Sebastian Kehr <kehr@ub.uni-leipzig.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2
*/
use fid\Hydrator\UserHydrator;
use fid\InputFilter\RootAwareBaseInputFilter;
use Zend\Form\Element\Collection;
use Zend\Form\Element\Hidden;
use Zend\Form\Element\Radio;
use Zend\Form\Element\Select;
use Zend\Form\Element\Submit;
use Zend\Form\Element\Text;
use Zend\Form\Fieldset;
use Zend\Form\InputFilterProviderFieldset;
return [
'elements' => [
'job_title' => [
'spec' => [
'options' => [
'value_options' => [
'job_title_2',
'job_title_3',
],
],
],
],
],
];
...@@ -33,6 +33,7 @@ $config = [ ...@@ -33,6 +33,7 @@ $config = [
'user-init-form' => require 'user-init-form.php', 'user-init-form' => require 'user-init-form.php',
'user-create-form' => require 'user-create-form.php', 'user-create-form' => require 'user-create-form.php',
'user-update-form' => require 'user-update-form.php', 'user-update-form' => require 'user-update-form.php',
'admin-edit-form' => require 'admin-edit-form.php',
], ],
'controllers' => [ 'controllers' => [
'factories' => [ 'factories' => [
......
...@@ -46,6 +46,17 @@ return [ ...@@ -46,6 +46,17 @@ return [
], ],
], ],
], ],
'job_title' => [
'spec' => [
'options' => [
'label' => 'label_job_title',
'value_options' => [
'job_title_2',
'job_title_3'
],
],
],
],
], ],
'input_filter' => [ 'input_filter' => [
'type' => UserCreateFormInputFilter::class, 'type' => UserCreateFormInputFilter::class,
......
...@@ -39,7 +39,17 @@ class UserCreateFormInputFilter extends BaseInputFilter ...@@ -39,7 +39,17 @@ class UserCreateFormInputFilter extends BaseInputFilter
$permissions = []; $permissions = [];
switch ($values['job_title']) { switch ($values['job_title']) {
case '0': case '0':
$permissions['extended_access'] = 'requested';
$permissions['full_access'] = 'requested'; $permissions['full_access'] = 'requested';
break;
case '2':
case '3':
$permissions['extended_access'] = 'requested';
$permissions['full_access'] = 'denied';
break;
case '1':
$permissions['extended_access'] = 'denied';
$permissions['full_access'] = 'denied';
} }
return $permissions; return $permissions;
......
label_access_level_full_access = "Hochschullehrer*innen, wissenschaftliche Mitarbeiter*innen, Mitglieder von Fachgesellschaften, Doktorand*innen, Stipendiat*innen oder externe Wissenschaftler*innen (z. B. Lehrbeauftragte)" label_access_level_full_access = "Hochschullehrer*innen, wissenschaftliche Mitarbeiter*innen, Mitglieder von Fachgesellschaften, Doktorand*innen, Stipendiat*innen oder externe Wissenschaftler*innen (z. B. Lehrbeauftragte)"
auth_error_account_blocked = "Ihr Konto wurde aus Sicherheitsgründen gesperrt. Bitte kontaktieren Sie uns unter fid@hab.de, um eine Entsperrung vorzunehmen." auth_error_account_blocked = "Ihr Konto wurde aus Sicherheitsgründen gesperrt. Bitte kontaktieren Sie uns unter fid@hab.de, um eine Entsperrung vorzunehmen."
\ No newline at end of file
job_title_0 = "HochschullehrerInnen, wissenschaftliche MitarbeiterInnen, Mitglied einer Fachgesellschaft, DoktorandInnen, StipendiatInnen oder externe WissenschaftlerInnen (z. B. Lehrbeauftragte)"
job_title_1 = "Studierende und weitere Interessierte"
job_title_2 = "Berufspraktiker, wissenschaftliche Mitarbeiter*Innen an Bibliotheken, Archiven und Sammlungsinstitutionen (Fachreferenten, Referendare)"
job_title_3 = "Nutzende der Herzog August Bibliothek"
\ No newline at end of file
auth_error_account_blocked = "Your account has been disabled due to security reasons. Please contact us at fid@hab.de for more details." auth_error_account_blocked = "Your account has been disabled due to security reasons. Please contact us at fid@hab.de for more details."
\ No newline at end of file
job_title_0 = "Professor, Research Associate/Assistant, Member of an Academic Association, PhD Student (also Scholarships), (Visiting) Lecturer"
job_title_1 = "Students, other interested people"
job_title_2 = "Professional practitioners, research personnel employed in libraries, archives and other collecting institutions (subject librarians, trainee subject librarians)"
job_title_3 = "Users of the Herzog August Bibliothek"
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment