Skip to content

Commit

Permalink
fix: init role add confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
krissss committed Jan 16, 2019
1 parent ca62c97 commit 11f4f25
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions modules/auth/console/controllers/InitAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,17 @@ class InitAuthController extends Controller
*/
public function actionRestore()
{
$transaction = Yii::$app->db->beginTransaction();
try {
$this->initAuthOperations();
$this->initAuthRole();
$transaction->commit();
} catch (Exception $exception) {
$transaction->rollBack();
throw $exception;
$isOk = $this->confirm('delete role?');
if ($isOk) {
$transaction = Yii::$app->db->beginTransaction();
try {
$this->initAuthOperations();
$this->initAuthRole();
$transaction->commit();
} catch (Exception $exception) {
$transaction->rollBack();
throw $exception;
}
}
}

Expand Down

0 comments on commit 11f4f25

Please sign in to comment.