namespace IPF\Auth\Admin;
+use IPF_Project;
+use IPF_Application;
use \IPF\Auth\Role as Role;
use \IPF\Auth\Permission as Permission;
use \PFF\HtmlBuilder\Text as Text;
public function slug() { return 'role'; }
}
-if (\PFF\Container::auth()->arePermissionsEnabled()) {
- return array(
- 'IPF\Auth\Admin\AdminUser',
- 'IPF\Auth\Admin\AdminRole',
- );
-} else {
- return array(
- 'IPF\Auth\Admin\AdminUser',
- );
+class AuthAdminSection implements \IPF_Admin_ISection
+{
+ public function components(IPF_Project $project, IPF_Application $app)
+ {
+ $components = array(
+ new AdminUser(),
+ );
+
+ if ($app->arePermissionsEnabled()) {
+ $components[] = new AdminRole();
+ }
+
+ return $components;
+ }
}
+return new AuthAdminSection;