Skip to content

Commit

Permalink
fix #3990 プラグインを無効にして再度インストールするとアクセスルール設定が重複して登録される (#4132)
Browse files Browse the repository at this point in the history
  • Loading branch information
cu-akasakay authored Feb 27, 2025
1 parent 84ea951 commit 4d41246
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use BaserCore\Annotation\UnitTest;
use BaserCore\Annotation\NoTodo;
use BaserCore\Annotation\Checked;
use BaserCore\Service\PermissionGroupsServiceInterface;

/**
* Class PluginsController
Expand Down Expand Up @@ -200,18 +201,21 @@ public function get_core_update(PluginsAdminServiceInterface $service)
* 無効化
*
* @param PluginsServiceInterface $service
* @param PermissionGroupsServiceInterface $permissionGroupService
* @param string $name プラグイン名
* @checked
* @noTodo
* @unitTest
*/
public function detach(PluginsServiceInterface $service, $name)
public function detach(PluginsServiceInterface $service, PermissionGroupsServiceInterface $permissionGroupService, $name)
{
if (!$this->request->is('post')) {
$this->BcMessage->setError(__d('baser_core', '無効な処理です。'));
return $this->redirect(['action' => 'index']);
}
if ($service->detach(rawurldecode($name))) {
// アクセスルールを削除
$permissionGroupService->deleteByPlugin($name);
$this->BcMessage->setSuccess(sprintf(__d('baser_core', 'プラグイン「%s」を無効にしました。'), rawurldecode($name)));
} else {
$this->BcMessage->setError(__d('baser_core', 'プラグインの無効化に失敗しました。'));
Expand Down

0 comments on commit 4d41246

Please sign in to comment.