Fix access control in Admin Index and Navbar components
This commit is contained in:
parent
3fe58ec66b
commit
d7001937ac
@ -11,7 +11,7 @@ class Index extends Component
|
|||||||
public $users = [];
|
public $users = [];
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
if (isInstanceAdmin() && session('adminToken') === null) {
|
if (!isInstanceAdmin() && session('adminToken') === null) {
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
}
|
}
|
||||||
$this->users = User::whereHas('teams', function ($query) {
|
$this->users = User::whereHas('teams', function ($query) {
|
||||||
|
@ -142,7 +142,7 @@ class="{{ request()->is('settings*') ? 'text-warning icon' : 'icon' }}"
|
|||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</details>
|
</details>
|
||||||
@if (isCloud())
|
@if (isCloud() && isInstanceAdmin())
|
||||||
<li title="Admin">
|
<li title="Admin">
|
||||||
<a class="hover:bg-transparent" href="/admin">
|
<a class="hover:bg-transparent" href="/admin">
|
||||||
<svg class="text-pink-600 icon" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg">
|
<svg class="text-pink-600 icon" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
Loading…
Reference in New Issue
Block a user