fixed role update

This commit is contained in:
denisdulici 2019-12-13 17:27:57 +03:00
parent a6bf8e0690
commit f36e57a2de

View File

@ -698,13 +698,11 @@ class Version200 extends Listener
'description' => ucfirst($permissionValue) . ' ' . $moduleName, 'description' => ucfirst($permissionValue) . ' ' . $moduleName,
]); ]);
$this->command->info('Creating Permission to '.$permissionValue.' for '. $moduleName); if ($role->hasPermission($permission->name)) {
continue;
if (!$role->hasPermission($permission->name)) {
$role->attachPermission($permission);
} else {
$this->command->info($role_name . ': ' . $p . ' ' . $permissionValue . ' already exist');
} }
$role->attachPermission($permission);
} }
} }
} }