mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 22:38:52 +00:00
[ticket/11582] Fix extension permission tests
PHPBB3-11582
This commit is contained in:
parent
060754fd6c
commit
cfb13bb547
2 changed files with 41 additions and 2 deletions
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Admin Permissions
|
|
||||||
$lang = array_merge($lang, array(
|
$lang = array_merge($lang, array(
|
||||||
'acl_u_foo' => array('lang' => 'Can view foo', 'cat' => 'misc'),
|
'ACL_U_FOO' => 'Can view foo',
|
||||||
));
|
));
|
||||||
|
|
Loading…
Add table
Reference in a new issue