Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
插件安装卸载时增加刷新默认权限操作
  • Loading branch information
zhaolaisong committed Mar 1, 2018
commit ccb7c49b1a2761555cfb975ba1680e55e8352bfb
4 changes: 4 additions & 0 deletions Command/PluginRegisterCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->write(' - Refresh plugin cache.');
$installer->refreshInstalledPluginConfiguration();
$output->writeln($executed ? ' <info>[Ok]</info>' : ' <info>[Ignore]</info>');

$output->write(' - Refresh default roles.');
$installer->refreshDefaultRoles();
$output->writeln(' <info>[Ok]</info>');

$output->writeln("<info>Finished!</info>\n");
}
Expand Down
4 changes: 4 additions & 0 deletions Command/PluginRemoveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->write(' - Refresh plugin cache.');
$register->refreshInstalledPluginConfiguration();
$output->writeln('<info>[Ok]</info>');

$output->write(' - Refresh default roles.');
$installer->refreshDefaultRoles();
$output->writeln(' <info>[Ok]</info>');

$output->writeln("<info>Finished!</info>\n");
}
Expand Down
5 changes: 5 additions & 0 deletions System/PluginRegister.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ public function refreshInstalledPluginConfiguration()
$this->refreshInstalledPluginRouting($installeds);
}

public function refreshDefaultRoles()
{
$plugins = $this->biz->service('Role:RoleService')->refreshRoles();
}

protected function refreshInstalledPluginRouting($plugins)
{
$fs = new Filesystem();
Expand Down