In my account model, I have an attribute called account_type_id upon registration if the user chooses his account to be an Admin account then it is set to 1 if however the user will be just an ordinary user it is set to 2 how do I change the access rules so that only the ones which are set to 1 can update or delete?
this is a sample of my code
public function accessRules()
{
$account=Account::model()->FindAll();
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view'),
'users'=>array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('create'),
'users'=>array('@'),
),
array('allow',
'action'=>array('update', 'delete', 'admin'),
'expression'=>"{$account->account_type_id}==1",
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}