public function actionDataPermissionInsertInheritance()
    {
        $navId = (int) Yii::$app->request->getBodyParam('navId');
        $groupId = (int) Yii::$app->request->getBodyParam('groupId');

        if (empty($navId) || empty($groupId)) {
            throw new InvalidArgumentException("navId and groupId can not be empty.");
        }

        $exists = (new Query())->from("cms_nav_permission")->where(['group_id' => $groupId, 'nav_id' => $navId])->exists();

        if ($exists) {
            Yii::$app->db->createCommand()->delete('cms_nav_permission', ['group_id' => $groupId, 'nav_id' => $navId])->execute();
        }

        return Yii::$app->db->createCommand()->insert('cms_nav_permission', ['group_id' => $groupId, 'nav_id' => $navId, 'inheritance' => true])->execute();
    }