public function actionDataPermissionDeleteInheritance()
    {
        $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) {
            return Yii::$app->db->createCommand()->delete('cms_nav_permission', ['group_id' => $groupId, 'nav_id' => $navId])->execute();
        }

        return false;
    }
public function actionDataPermissionDeleteInheritance()
    {
        $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) {
            return Yii::$app->db->createCommand()->delete('cms_nav_permission', ['group_id' => $groupId, 'nav_id' => $navId])->execute();
        }

        return false;
    }
public function actionDataPermissionDeleteInheritance ( ) { $ 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 ) { return Yii :: $ app -> db -> createCommand ( ) -> delete ( 'cms_nav_permission' , [ 'group_id' => $ groupId , 'nav_id' => $ navId ] ) -> execute ( ) ; } return false ; }
Delete the permission inheritance for a given group and nav id.
Delete the permission inheritance for a given group and nav id .