Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sistema_mcid
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
marcio neto
sistema_mcid
Commits
024efa2b
Commit
024efa2b
authored
Aug 25, 2023
by
sandroresende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alteracao AuthService
parent
0771caab
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
101 deletions
+7
-101
AuthServiceProvider copy.php
app/Providers/AuthServiceProvider copy.php
+0
-101
AuthServiceProvider.php
app/Providers/AuthServiceProvider.php
+7
-0
No files found.
app/Providers/AuthServiceProvider copy.php
deleted
100644 → 0
View file @
0771caab
<?php
namespace
App\Providers
;
use
Illuminate\Auth\Notifications\ResetPassword
;
use
Illuminate\Support\Facades\Gate
;
use
Illuminate\Foundation\Support\Providers\AuthServiceProvider
as
ServiceProvider
;
use
Illuminate\Notifications\Messages\MailMessage
;
class
AuthServiceProvider
extends
ServiceProvider
{
/**
* The password reset token.
*
* @var string
*/
public
$token
;
/**
* The callback that should be used to build the mail message.
*
* @var \Closure|null
*/
public
static
$toMailCallback
;
/**
* The policy mappings for the application.
*
* @var array
*/
protected
$policies
=
[
'App\Model'
=>
'App\Policies\ModelPolicy'
,
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public
function
boot
()
{
$this
->
registerPolicies
();
Gate
::
define
(
'eAdmin'
,
function
(
$user
)
{
return
$user
->
tipo_usuario_id
==
1
;
});
Gate
::
define
(
'eConsulta'
,
function
(
$user
)
{
$tipoUsuario
=
[
1
,
2
,
3
,
4
,
5
,
6
];
if
(
in_array
(
$user
->
tipo_usuario_id
,
$tipoUsuario
)){
return
true
;
}
return
false
;
});
Gate
::
define
(
'eGestao'
,
function
(
$user
)
{
if
((
$user
->
tipo_usuario_id
==
1
)
||
(
$user
->
tipo_usuario_id
==
6
)){
return
true
;
}
return
false
;
});
Gate
::
define
(
'eSaci'
,
function
(
$user
)
{
if
((
$user
->
tipo_usuario_id
==
1
)
||
(
$user
->
tipo_usuario_id
==
12
)){
return
true
;
}
return
false
;
});
ResetPassword
::
toMailUsing
(
function
(
$notifiable
)
{
if
(
static
::
$toMailCallback
)
{
return
call_user_func
(
static
::
$toMailCallback
,
$notifiable
,
$this
->
token
);
}
return
(
new
MailMessage
)
->
subject
(
'Notificação de resete de Senha'
)
->
line
(
'Você está recebendo este e-mail porque recebemos uma solicitação de redefinição de senha para sua conta.'
)
->
action
(
'Resetar senha'
,
url
(
config
(
'app.url'
)
.
route
(
'password.reset'
,
$this
->
token
,
false
)))
->
line
(
'Se você não solicitou uma redefinição de senha, nenhuma outra ação será necessária.'
);
});
}
}
app/Providers/AuthServiceProvider.php
View file @
024efa2b
...
...
@@ -30,6 +30,13 @@ class AuthServiceProvider extends ServiceProvider
return
$user
->
tipo_usuario_id
==
1
;
});
Gate
::
define
(
'eGestao'
,
function
(
$user
)
{
if
((
$user
->
tipo_usuario_id
==
1
)
||
(
$user
->
tipo_usuario_id
==
6
)){
return
true
;
}
return
false
;
});
Gate
::
define
(
'eConsulta'
,
function
(
$user
)
{
$tipoUsuario
=
[
1
,
2
,
3
,
4
,
5
,
6
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment