From 31f2742024ceeed4013da54903da0d0bed7ee0c5 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Sat, 14 Jan 2012 23:16:35 +0200 Subject: [PATCH] preload permission model --- ipf/auth/app.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/ipf/auth/app.php b/ipf/auth/app.php index 001b141..0209f20 100644 --- a/ipf/auth/app.php +++ b/ipf/auth/app.php @@ -1,11 +1,15 @@ self::ArePermissionsEnabled(true) ? array('User', 'Role',) : array('User'), + 'models' => self::ArePermissionsEnabled() ? array('User', 'Role') : array('User'), )); } @@ -116,15 +120,8 @@ class IPF_Auth_App extends IPF_Application } } - static function ArePermissionsEnabled($use_hack=false) + static function ArePermissionsEnabled() { - if ($use_hack) - { - $path = str_replace('app.php','',__FILE__); - require_once($path.'models/_generated/BasePermission.php'); - require_once($path.'models/Permission.php'); - } - return IPF_ORM_Query::create()->from('Permission')->count() ? true : false; } -- 2.49.0