Skip to content

Commit

Permalink
Merge pull request #75 from wgnann/master
Browse files Browse the repository at this point in the history
fix issue #74
  • Loading branch information
thiagogomesverissimo authored Jun 29, 2023
2 parents 0d6efd7 + ddd9b42 commit 0bdd9e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,9 @@ CUPS_SERVER_IP=192.168.8.43
PRINTING_DRIVER=cups
CUPS_SERVER_USERNAME=root
CUPS_SERVER_PASSWORD=123

#Ativa o uso do replicado para obter os monitores (default: true)
#REPLICADO_MONITORES=true

#Lista os monitores caso REPLICADO_MONITORES=false (default: vazio)
#MONITORES=
5 changes: 4 additions & 1 deletion app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ public function boot()
Gate::define('monitor', function ($user) {
if(Gate::allows('admin')) return True;

$monitores = ReplicadoTemp::listarMonitores(22);
if (!env('REPLICADO_MONITORES', true))
$monitores = explode(',', env('MONITORES', ''));
else
$monitores = ReplicadoTemp::listarMonitores(22);

return in_array($user->codpes, $monitores);
});
Expand Down

0 comments on commit 0bdd9e1

Please sign in to comment.