Skip to content

Commit

Permalink
Fix plugin authorization by registered route
Browse files Browse the repository at this point in the history
  • Loading branch information
Timot Tarjani committed Nov 2, 2023
1 parent 95217eb commit 1251405
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ public function boot()
}


if(!in_array(str_replace("-","",$this->app->request->is($prefix.'/plugin/run/*')? $this->app->request->segment(4) : $this->app->request->segment(2)),$user->role->rights)){
if(
!in_array(str_replace("-","",$this->app->request->is($prefix.'/plugin/run/*')? $this->app->request->segment(4) : $this->app->request->segment(2)),$user->role->rights) &&
!in_array(str_replace("-","",$this->app->request->is($prefix.'/plugin/*')? $this->app->request->segment(3) : $this->app->request->segment(1)),$user->role->rights)
){
return false;
}

Expand Down

0 comments on commit 1251405

Please sign in to comment.