mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Only limit template creator scope when authenticated
This commit is contained in:
parent
2768f19b7c
commit
0883321d9e
|
@ -36,7 +36,9 @@ class ReportTemplate extends Model
|
||||||
{
|
{
|
||||||
// Scope to current user
|
// Scope to current user
|
||||||
static::addGlobalScope('current_user', function (Builder $builder) {
|
static::addGlobalScope('current_user', function (Builder $builder) {
|
||||||
|
if (auth()->check()) {
|
||||||
$builder->where('user_id', auth()->id());
|
$builder->where('user_id', auth()->id());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue