[ticket/11582] Fix extension permission tests

PHPBB3-11582
This commit is contained in:
Joas Schilling 2013-07-13 23:31:13 -04:00
parent 060754fd6c
commit cfb13bb547
2 changed files with 41 additions and 2 deletions

View file

@ -0,0 +1,40 @@
<?php
/**
*
* @package testing
* @copyright (c) 2013 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Event listener
*/
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class phpbb_ext_foo_bar_event_permission_listener implements EventSubscriberInterface
{
static public function getSubscribedEvents()
{
return array(
'core.permissions' => 'add_permissions',
);
}
public function add_permissions($event)
{
$permissions = $event['permissions'];
$permissions['u_foo'] = array('lang' => 'ACL_U_FOO', 'cat' => 'misc'),
$event['permissions'] = $permissions;
}
}

View file

@ -1,6 +1,5 @@
<?php
// Admin Permissions
$lang = array_merge($lang, array(
'acl_u_foo' => array('lang' => 'Can view foo', 'cat' => 'misc'),
'ACL_U_FOO' => 'Can view foo',
));