diff --git a/module/fid/config/user-create-form.php b/module/fid/config/user-create-form.php index 3d4969eae965f83a3a66fd148890e89cb4587887..9a32a6917aed5231d1a543329b1bde7b33cfa882 100644 --- a/module/fid/config/user-create-form.php +++ b/module/fid/config/user-create-form.php @@ -21,6 +21,7 @@ use fid\Hydrator\UserHydrator; use fid\InputFilter\RootAwareBaseInputFilter; +use fid\InputFilter\UserCreateFormInputFilter; use Zend\Filter\Boolean; use Zend\Filter\StringTrim; use Zend\Form\Element\Checkbox; @@ -194,7 +195,7 @@ return [ ], ], 'input_filter' => [ - 'type' => RootAwareBaseInputFilter::class, + 'type' => UserCreateFormInputFilter::class, 'username' => [ 'name' => 'username', 'filters' => [ diff --git a/module/fid/src/InputFilter/UserCreateFormInputFilter.php b/module/fid/src/InputFilter/UserCreateFormInputFilter.php new file mode 100644 index 0000000000000000000000000000000000000000..41b6ca3c01eac83e02da270c31dd879c2e837445 --- /dev/null +++ b/module/fid/src/InputFilter/UserCreateFormInputFilter.php @@ -0,0 +1,31 @@ +<?php +/** + * Copyright (C) 2019 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 + */ + +namespace fid\InputFilter; + +class UserCreateFormInputFilter extends RootAwareBaseInputFilter +{ + public function getValues() + { + $permissions = ['basic_access' => 'granted']; + return compact('permissions') + parent::getValues(); + } +} \ No newline at end of file