27 public $superuserName =
'Admin';
31 public $authenticatedName =
'Authenticated';
35 public $userClass =
'User';
39 public $userIdColumn =
'id';
43 public $userNameColumn =
'username';
47 public $enableBizRule =
true;
51 public $enableBizRuleData =
false;
56 public $displayDescription =
true;
60 public $flashSuccessKey =
'RightsSuccess';
64 public $flashErrorKey =
'RightsError';
68 public $install =
false;
72 public $baseUrl =
'/rights';
76 public $layout =
'rights.views.layouts.main';
80 public $appLayout =
'application.views.layouts.main';
88 public $debug =
false;
98 $this->setImport(array(
99 'rights.components.*',
100 'rights.components.behaviors.*',
101 'rights.components.dataproviders.*',
102 'rights.controllers.*',
104 'common.extensions.eauth.*',
105 'common.extensions.eauth.services.*',
109 $this->setComponents(array(
111 'class'=>
'RAuthorizer',
112 'superuserName'=>$this->superuserName,
115 'class'=>
'RGenerator',
120 $this->defaultController =
'assignment';
123 if( $this->install===
true )
125 $this->setComponents(array(
127 'class'=>
'RInstaller',
128 'superuserName'=>$this->superuserName,
129 'authenticatedName'=>$this->authenticatedName,
130 'guestName'=>Yii::app()->user->guestName,
131 'defaultRoles'=>Yii::app()->authManager->defaultRoles,
136 $this->defaultController =
'install';
149 $cs = Yii::app()->getClientScript();
150 $cs->registerCoreScript(
'jquery');
151 $cs->registerCoreScript(
'jquery.ui');
152 $cs->registerScriptFile($assetsUrl.
'/js/rights.js');
153 $cs->registerCssFile($assetsUrl.
'/css/core.css');
156 if( $this->cssFile!==
false )
159 if( $this->cssFile===null )
160 $this->cssFile = $assetsUrl.
'/css/default.css';
162 $this->cssFile = Yii::app()->request->baseUrl.$this->cssFile;
165 $cs->registerCssFile($this->cssFile);
175 if( $this->_assetsUrl===null )
177 $assetsPath = Yii::getPathOfAlias(
'rights.assets');
180 if( $this->debug===
true )
181 $this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath,
true, -1,
true);
183 $this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath,
true);
186 return $this->_assetsUrl;
194 return $this->getComponent(
'authorizer');
202 return $this->getComponent(
'installer');
210 return $this->getComponent(
'generator');