From: Andrey Kutejko Date: Sat, 14 Jan 2012 21:16:35 +0000 (+0200) Subject: preload permission model X-Git-Tag: 0.5~323 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=31f2742024ceeed4013da54903da0d0bed7ee0c5;p=ipf.git preload permission model --- 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; }