Only show Network Admin if the user is a ZC of a network
This commit is contained in:
parent
c4169248ff
commit
eca9f257eb
@ -79,4 +79,14 @@ class User extends Authenticatable implements MustVerifyEmail
|
|||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is this user a ZC of a domain?
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isZC(): bool
|
||||||
|
{
|
||||||
|
return $this->systems->pluck('addresses')->flatten()->where('role',Address::NODE_ZC)->count() > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,19 +11,21 @@
|
|||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
@auth
|
@auth
|
||||||
<dl>
|
@if ($user->isZC())
|
||||||
<dt>Network Admin</dt>
|
<dl>
|
||||||
<dd><a href="{{ url('ftn/domain') }}">Domains</a></dd>
|
<dt>Network Admin</dt>
|
||||||
<dd><a href="{{ url('ftn/system') }}">Systems</a></dd>
|
<dd><a href="{{ url('ftn/domain') }}">Domains</a></dd>
|
||||||
<dd><a href="{{ url('ftn/zone') }}">Zones</a></dd>
|
<dd><a href="{{ url('ftn/system') }}">Systems</a></dd>
|
||||||
<dd><a href="{{ url('ftn/echoarea') }}">Echoareas</a></dd>
|
<dd><a href="{{ url('ftn/zone') }}">Zones</a></dd>
|
||||||
<dd><a href="{{ url('ftn/filearea') }}">Fileareas</a></dd>
|
<dd><a href="{{ url('ftn/echoarea') }}">Echoareas</a></dd>
|
||||||
</dl>
|
<dd><a href="{{ url('ftn/filearea') }}">Fileareas</a></dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt>System Admin</dt>
|
<dt>System Admin</dt>
|
||||||
<dd><a href="{{ url('ftn/our_systems') }}">This Host Systems</a></dd>
|
<dd><a href="{{ url('ftn/our_systems') }}">This Host Systems</a></dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
@endif
|
||||||
|
|
||||||
@can('admin')
|
@can('admin')
|
||||||
<dl>
|
<dl>
|
||||||
|
Loading…
Reference in New Issue
Block a user