Protected Member Functions |
| loadAro () |
Protected Attributes |
| $aro = NULL |
Detailed Description
Member Function Documentation
This method takes care to associate an ARO-collection with this one
- Parameters:
-
Definition at line 84 of file RequestingActiveRecordBehavior.php.
{
$owner = $this->getOwner();
if($owner->isNewRecord){
$aro->model = get_class($owner);
$aro->foreign_key = $this->getPrimaryKey();
throw new RuntimeError("Unable to save Aro-Collection");
}
}
This method takes care that every associated ACL-objects are properly removed
Definition at line 99 of file RequestingActiveRecordBehavior.php.
{
$owner = $this->getOwner();
$aro = $class::model()->find(
'model = :model AND foreign_key = :key', array(
':model' => get_class($owner),
':key' => $owner->id));
throw new RuntimeException('No associated Aro-Collection!');
$transaction = Yii::app()->db->beginTransaction();
try{
$transaction->commit();
return $suc;
}
catch(Exception $e){
$transaction->rollback();
throw $e;
}
}
Denies the object denoted by the $obj-identifier the given actions
- Parameters:
-
type | $obj | the object identifier |
array | $actions | the actions to deny |
- Returns:
- bool
Definition at line 74 of file RequestingActiveRecordBehavior.php.
{
return $this->aro->deny($obj, $actions);
}
Grants the object denoted by the $obj-identifier the given actions
- Parameters:
-
type | $obj | the object identifier |
array | $actions | the actions to grant |
- Returns:
- bool
Definition at line 63 of file RequestingActiveRecordBehavior.php.
{
return $this->aro->grant($obj, $actions);
}
Loads the associated Aro_Object
- Exceptions:
-
Definition at line 25 of file RequestingActiveRecordBehavior.php.
{
$owner = $this->getOwner();
if($this->aro === NULL){
$this->aro = $class::model()->find('model = :model AND foreign_key = :foreign_key',
array(':model' => get_class($owner), 'foreign_key' => $owner->id));
if(!$this->aro && $guest){
$this->aro = $class::model()->find('alias = :alias', array(':alias' => $guest));
if(!$this->aro)
throw new RuntimeException('There is no associated Aro nor a guest-group');
}
}
}
Looks up if the user is granted a specific action to the given object
- Parameters:
-
string | array | $obj | The object to be checked |
string | $action | the action to be performed |
- Returns:
- bool true if access is granted, false otherwise
Definition at line 52 of file RequestingActiveRecordBehavior.php.
{
return $this->aro->may($obj, $action);
}
Field Documentation
The documentation for this class was generated from the following file: