Skip to content
Snippets Groups Projects
Commit cf97fa12 authored by Alex Arnaud's avatar Alex Arnaud
Browse files

dev#218054 : Save user group empty site filter as all

parent 04dec6ca
Branches
Tags
1 merge request!5141dev#218054 : Save user group empty site filter as all
Pipeline #45971 passed with stage
in 39 minutes and 55 seconds
- correctif #218054 : correction du filtre sur les bibliothèques dans les groupes utilisateurs
\ No newline at end of file
......@@ -203,6 +203,10 @@ class ZendAfi_Controller_Plugin_Manager_UserGroup
$this->_permissions_access = ZendAfi_Form_Admin_UserGroup::deletePrefix($rights_permissions,
ZendAfi_Form_Admin_UserGroup::PERMISSION);
$multi_lib_name = (new Class_User_SearchCriteriaMultiLibraries([]))->getName();
if (isset($post[$multi_lib_name]))
$post[$multi_lib_name] |= 'all';
unset($post[ZendAfi_Form_Admin_UserGroup::RIGHTS_PERMISSIONS]);
return $post;
}
......
<?php
/**
* Copyright (c) 2012-2024, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH 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.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH 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 BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class UserGroupControllerPostEmptySiteTest extends Admin_AbstractControllerTestCase
{
public function setUp(): void
{
parent::setUp();
$this->fixture(Class_UserGroup::class,
['id' => 77,
'protected' => false,
'libelle' => 'Accés aux ressources numériques',
'group_type' => Class_UserGroup::TYPE_DYNAMIC,
'users' => [],
'rights' => []]);
$this->postDispatch('admin/usergroup/edit/id/77',
['libelle' => 'Accés aux ressources numériques',
'search_id_site' => '']);
}
/** @test */
public function searchIdSiteFilterShouldBeSavedAsAll()
{
$this->assertEquals('all', json_decode(Class_UserGroup::find(77)
->getFilters())->search_id_site);
}
}
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