models/Rule.php
public function create()
    {
        if ($this->scenario != self::SCENARIO_CREATE) {
            return false;
        }

        if (!$this->validate()) {
            return false;
        }

        $rule = \Yii::createObject([
            'class' => $this->class,
            'name'  => $this->name,
        ]);
        
        $this->authManager->add($rule);
        $this->authManager->invalidateCache();
        
        return true;
    }
public function create()
    {
        if ($this->scenario != self::SCENARIO_CREATE) {
            return false;
        }

        if (!$this->validate()) {
            return false;
        }

        $rule = \Yii::createObject([
            'class' => $this->class,
            'name'  => $this->name,
        ]);
        
        $this->authManager->add($rule);
        $this->authManager->invalidateCache();
        
        return true;
    }
public function create ( ) { if ( $ this -> scenario != self :: SCENARIO_CREATE ) { return false ; } if ( ! $ this -> validate ( ) ) { return false ; } $ rule = \ Yii :: createObject ( [ 'class' => $ this -> class , 'name' => $ this -> name , ] ) ; $ this -> authManager -> add ( $ rule ) ; $ this -> authManager -> invalidateCache ( ) ; return true ; }
Creates new auth rule.

@return bool
@throws InvalidConfigException
Creates new auth rule .