Created a 'zc' role to be used when a user is a ZC of a domain, or a site admin
This commit is contained in:
parent
48ed6eb8ea
commit
c414ebd053
@ -27,8 +27,10 @@ class AuthServiceProvider extends ServiceProvider
|
|||||||
{
|
{
|
||||||
$this->registerPolicies();
|
$this->registerPolicies();
|
||||||
|
|
||||||
Gate::define('admin',function (User $o) {
|
// Mailer Admin
|
||||||
return $o->admin === TRUE;
|
Gate::define('admin',fn(User $o)=>($o->admin === TRUE));
|
||||||
});
|
|
||||||
|
// ZC of a Zone
|
||||||
|
Gate::define('zc',fn(User $o)=>(($o->admin === TRUE) || $o->ZC()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,28 +2,33 @@
|
|||||||
FTN Networks
|
FTN Networks
|
||||||
|
|
||||||
@auth
|
@auth
|
||||||
<dl>
|
@if($user->systems->count())
|
||||||
<dt>My Systems</dt>
|
<dl>
|
||||||
@foreach ($user->systems->sortBy('name') as $o)
|
<dt>My Systems</dt>
|
||||||
<dd><a href="{{ url('system/addedit',['id'=>$o->id]) }}">{{ $o->name }}</a></dd>
|
@foreach ($user->systems->sortBy('name') as $o)
|
||||||
@endforeach
|
<dd><a href="{{ url('system/addedit',['id'=>$o->id]) }}">{{ $o->name }}</a></dd>
|
||||||
</dl>
|
@endforeach
|
||||||
|
</dl>
|
||||||
|
@endif
|
||||||
@endauth
|
@endauth
|
||||||
|
|
||||||
<dl>
|
@if(($x=\App\Models\Domain::select(['id','name'])
|
||||||
<dt>Explore Networks</dt>
|
->when(((! $user) || (! $user->isAdmin())),fn($query)=>$query->public()->active())
|
||||||
@foreach (\App\Models\Domain::select(['id','name'])
|
->orderBy('name')
|
||||||
->when(((! $user) || (! $user->isAdmin())),function($query) { return $query->public()->active(); })
|
->get())
|
||||||
->orderBy('name')
|
->count())
|
||||||
->get() as $o)
|
<dl>
|
||||||
@if ($o->isManaged())
|
<dt>Explore Networks</dt>
|
||||||
<dd><a href="{{ url('domain/view',['id'=>$o->id]) }}">{{ $o->name }}</a></dd>
|
@foreach ($x as $o)
|
||||||
@endif
|
@if ($o->isManaged())
|
||||||
@endforeach
|
<dd><a href="{{ url('domain/view',['id'=>$o->id]) }}">{{ $o->name }}</a></dd>
|
||||||
</dl>
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</dl>
|
||||||
|
@endif
|
||||||
|
|
||||||
@auth
|
@auth
|
||||||
@if ($user->isZC())
|
@can('zc')
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Network Admin</dt>
|
<dt>Network Admin</dt>
|
||||||
<dd><a href="{{ url('domain') }}">Domains</a></dd>
|
<dd><a href="{{ url('domain') }}">Domains</a></dd>
|
||||||
@ -32,7 +37,7 @@
|
|||||||
<dd><a href="{{ url('echoarea') }}">Echoareas</a></dd>
|
<dd><a href="{{ url('echoarea') }}">Echoareas</a></dd>
|
||||||
<dd><a href="{{ url('filearea') }}">Fileareas</a></dd>
|
<dd><a href="{{ url('filearea') }}">Fileareas</a></dd>
|
||||||
</dl>
|
</dl>
|
||||||
@endif
|
@endcan
|
||||||
|
|
||||||
@can('admin')
|
@can('admin')
|
||||||
<dl>
|
<dl>
|
||||||
|
Loading…
Reference in New Issue
Block a user