[ticket/291] Add modules_helper and use for permission checks

B3P-291
This commit is contained in:
Marc Alexander
2014-07-07 15:16:29 +02:00
parent 0ae979e34a
commit 40f630a55d
10 changed files with 125 additions and 115 deletions

View File

@@ -11,12 +11,6 @@ namespace board3\portal\includes;
class helper
{
/**
* Auth object
* @var \phpbb\auth\auth
*/
private $auth;
/**
* Board3 Modules service collection
* @var \phpbb\di\service_collection
@@ -27,13 +21,11 @@ class helper
* Constructor
* NOTE: The parameters of this method must match in order and type with
* the dependencies defined in the services.yml file for this service.
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\di\service_collection $modules Board3 Modules service
* collection
*/
public function __construct($auth, $modules)
public function __construct($modules)
{
$this->auth = $auth;
$this->register_modules($modules);
}
@@ -72,24 +64,4 @@ class helper
return false;
}
}
/**
* Get an array of disallowed forums
*
* @param bool $disallow_access Whether the array for disallowing access
* should be filled
*/
public function get_disallowed_forums($disallow_access)
{
if ($disallow_access == true)
{
$disallow_access = array_unique(array_keys($this->auth->acl_getf('!f_read', true)));
}
else
{
$disallow_access = array();
}
return $disallow_access;
}
}