Refactoring user permissions

This commit is contained in:
xiaomlove
2022-08-20 19:11:28 +08:00
parent 3046837576
commit b79762686a
73 changed files with 945 additions and 326 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Nexus\Plugin\BasePlugin;
class Plugin extends Command
{
@@ -30,11 +31,18 @@ class Plugin extends Command
$plugin = new \Nexus\Plugin\Plugin();
$action = $this->argument('action');
$name = $this->argument('name');
/** @var BasePlugin $mainClass */
$mainClass = $plugin->getMainClass($name);
if (!$mainClass) {
$this->error("Can not find plugin: $name");
return 1;
}
try {
$mainClass->checkMainApplicationVersion();
} catch (\Exception $exception) {
$this->error($exception->getMessage());
return 1;
}
if ($action == 'install') {
call_user_func([$mainClass, 'install']);
} elseif ($action == 'uninstall') {