protected function applyRule(array $data)
    {
        if (!($class = ArrayHelper::get($data, 'class')) || !(class_exists($class))) {
            return false;
        }
        $rule = new $class;
        if (!$rule instanceof Rule) {
            return false;
        }
        if ($ruleExist = $this->authManager->getRule($rule->name)) {
            return $ruleExist;
        }
        if ($this->authManager->add($rule)) {
            return $rule;
        }
        return false;
    }