28 $owner = $this->getOwner();
30 if($this->aro === NULL){
31 $this->aro = $class::model()->find(
'model = :model AND foreign_key = :foreign_key',
32 array(
':model' => get_class($owner),
'foreign_key' => $owner->id));
36 if(!$this->aro && $guest){
37 $this->aro = $class::model()->find(
'alias = :alias', array(
':alias' => $guest));
41 throw new RuntimeException(
'There is no associated Aro nor a guest-group');
52 public function may($obj, $action){
54 return $this->aro->may($obj, $action);
63 public function grant($obj, $actions){
65 return $this->aro->grant($obj, $actions);
74 public function deny($obj, $actions){
76 return $this->aro->deny($obj, $actions);
85 $owner = $this->getOwner();
86 if($owner->isNewRecord){
89 $aro->model = get_class($owner);
90 $aro->foreign_key = $this->getPrimaryKey();
92 throw new RuntimeError(
"Unable to save Aro-Collection");
100 $owner = $this->getOwner();
103 $aro = $class::model()->find(
'model = :model AND foreign_key = :key', array(
':model' => get_class($owner),
':key' => $owner->id));
106 throw new RuntimeException(
'No associated Aro-Collection!');
108 $transaction = Yii::app()->db->beginTransaction();
111 $transaction->commit();
115 $transaction->rollback();