Skip to content

Commit

Permalink
[TM-515] Only assign spatie roles if the user doesn't already have them.
Browse files Browse the repository at this point in the history
  • Loading branch information
roguenet committed Apr 15, 2024
1 parent 93bd4c3 commit bbbc874
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Console/Commands/Migration/RolesMigrationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ public function handle()

User::whereIn('role', ['user','admin', 'terrafund-admin'])->get()
->each(function (User $user) {
assignSpatieRole($user);
if ($user->primary_role == null) {
assignSpatieRole($user);
}
});

if ($this->option('log')) {
Expand Down

0 comments on commit bbbc874

Please sign in to comment.