Commit 621502cf authored by Laurent's avatar Laurent

Merge branch 'hotline#47691_allow_library_modo_to_change_admin_skin' into 'stable'

hotline #47691 add action right schel in Acl by roles

See merge request !1894
parents 7a8389fc ccd0c69d
- ticket #47691 : Administration : le rôle rédacteur bibliothèque peut modifier le thème admin
\ No newline at end of file
......@@ -37,6 +37,7 @@ class ZendAfi_Acl_AdminControllerGroup {
'oai' => Class_UserGroup::RIGHT_USER_BIB_NUM,
'frbr-link' => Class_UserGroup::RIGHT_USER_NOTICES_LIEES,
'users' => Class_UserGroup::RIGHT_USER_SIGB_USER_READ,
'users/change-admin-skins' => null
],
$_activated = [];
......@@ -85,6 +86,10 @@ class ZendAfi_Acl_AdminControllerGroup {
return $this->_isAllowedByGroup($user, $right);
$acl = $this->getAcl();
if ($acl->isAllowed($user->getRole(),
$acl->has($controller . '/' . $action) ? $controller . '/' . $action : null))
return true;
return $acl->isAllowed($user->getRole(),
$acl->has($controller) ? $controller : null);
}
......
......@@ -69,6 +69,7 @@ class ZendAfi_Acl_AdminControllerRoles extends Zend_Acl {
$this->add(new Zend_Acl_Resource('bib'));
$this->add(new Zend_Acl_Resource('ouvertures'));
$this->add(new Zend_Acl_Resource('users'));
$this->add(new Zend_Acl_Resource('users/change-admin-skin'));
$this->add(new Zend_Acl_Resource('usergroup'));
$this->add(new Zend_Acl_Resource('formation'));
$this->add(new Zend_Acl_Resource('newsletter'));
......@@ -114,6 +115,7 @@ class ZendAfi_Acl_AdminControllerRoles extends Zend_Acl {
$this->allow('modo_bib','records');
$this->allow('modo_bib','modules');
$this->allow('modo_bib','redmine');
$this->allow('modo_bib','users/change-admin-skin');
$this->allow('admin_bib','rss');
$this->allow('admin_bib','catalogue');
......@@ -134,7 +136,6 @@ class ZendAfi_Acl_AdminControllerRoles extends Zend_Acl {
$this->allow('admin_bib','menus');
$this->allow('admin_bib','external-agendas');
$this->deny('modo_portail','catalogue');
$this->deny('modo_portail','rss');
$this->deny('modo_portail','external-agendas');
......
......@@ -1044,6 +1044,16 @@ class Admin_UsersControllerChangeAdminSkinActionTest extends Admin_AbstractContr
public function setUp() {
parent::setUp();
$redac = $this->fixture('Class_Users',
['id' => 5,
'login' => 'rédacteur',
'password' => 'msmdp',
'id_site' => '5',
'role_level' => ZendAfi_Acl_AdminControllerRoles::MODO_BIB]);
ZendAfi_Auth::getInstance()->logUser($redac);
$this->postDispatch('admin/users/change-admin-skin', ['admin_skin' => 'bokeh74',
'admin_skin_color' => 'red.css']);
}
......
......@@ -300,11 +300,29 @@ Trait MenuGaucheAdminRolesDefinition {
[ZendAfi_Acl_AdminControllerRoles::MODO_PORTAIL,
[
'cms',
'catalogue',
'rss',
'sito',
'external-agendas',
'modo',
'modo/membreview',
'newsletter',
'formation',
'lieu',
'bibnum',
'album',
'album/add-website',
'oai',
'import_ead',
'frbr-link',
'profil',
'print/index',
'profil/genres',
'stat/rechercheinfructueuse',
'bib',
'users',
'usergroup',
'zone'
] ],
[ZendAfi_Acl_AdminControllerRoles::ADMIN_BIB,
......@@ -334,13 +352,12 @@ Trait MenuGaucheAdminRolesDefinition {
'usergroup'
] ],
[ZendAfi_Acl_AdminControllerRoles::MODO_PORTAIL,
[ZendAfi_Acl_AdminControllerRoles::MODO_BIB,
[
'cms',
'sito',
'modo',
'modo/membreview',
'newsletter',
'stat/rechercheinfructueuse',
] ]
];
......@@ -348,6 +365,7 @@ Trait MenuGaucheAdminRolesDefinition {
}
class ZendAfi_View_Helper_Admin_MenuGaucheAdminRightsTest extends ViewHelperTestCase {
use MenuGaucheAdminRolesDefinition;
protected $_storm_default_to_volatile = true;
......@@ -383,7 +401,6 @@ class ZendAfi_View_Helper_Admin_MenuGaucheAdminRightsTest extends ViewHelperTest
}
/**
* @dataProvider pagesByRole
* @test
......
Markdown is supported
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