mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-03-23 23:10:10 +01:00
Rework permissions
This commit is contained in:
parent
a477165188
commit
2e09416011
@ -408,9 +408,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{{-- <! –– #### begin update detection #### ––> --}}
|
@if (env('NOTIFY_UPDATES') == 'true' or env('NOTIFY_UPDATES') === 'major' or env('NOTIFY_UPDATES') === 'all')
|
||||||
@if (auth()->user()->role == 'admin' &&
|
|
||||||
(env('NOTIFY_UPDATES') == 'true' or env('NOTIFY_UPDATES') === 'major' or env('NOTIFY_UPDATES') === 'all'))
|
|
||||||
|
|
||||||
{{-- <! –– Checks if file version.json exists AND if version.json exists on server to continue (without this PHP will throw ErrorException ) ––> --}}
|
{{-- <! –– Checks if file version.json exists AND if version.json exists on server to continue (without this PHP will throw ErrorException ) ––> --}}
|
||||||
@if (file_exists(base_path('version.json')))
|
@if (file_exists(base_path('version.json')))
|
||||||
@ -450,7 +448,7 @@
|
|||||||
{{-- Notification Modals --}}
|
{{-- Notification Modals --}}
|
||||||
@push('sidebar-scripts')
|
@push('sidebar-scripts')
|
||||||
@php
|
@php
|
||||||
function notification($dismiss = '', $ntid, $heading, $body)
|
function notification($adminOnly = false, $dismiss = '', $ntid, $heading, $body)
|
||||||
{
|
{
|
||||||
$closeMSG = __('messages.Close');
|
$closeMSG = __('messages.Close');
|
||||||
$dismissMSG = __('messages.Dismiss');
|
$dismissMSG = __('messages.Dismiss');
|
||||||
@ -458,7 +456,7 @@
|
|||||||
if ($dismiss) {
|
if ($dismiss) {
|
||||||
$dismissBtn = '<a href="' . url()->current() . '?dismiss=' . $dismiss . '" class="btn btn-danger">' . $dismissMSG . '</a>';
|
$dismissBtn = '<a href="' . url()->current() . '?dismiss=' . $dismiss . '" class="btn btn-danger">' . $dismissMSG . '</a>';
|
||||||
}
|
}
|
||||||
echo <<<MODAL
|
$body = <<<MODAL
|
||||||
<div class="modal fade" id="$ntid" data-bs-backdrop="true" data-bs-keyboard="false" tabindex="-1" aria-labelledby="${ntid}-label" aria-hidden="true">
|
<div class="modal fade" id="$ntid" data-bs-backdrop="true" data-bs-keyboard="false" tabindex="-1" aria-labelledby="${ntid}-label" aria-hidden="true">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
@ -478,15 +476,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
MODAL; // Indentation breaks my code editor :/
|
MODAL; // <-- Indentation breaks my code editor :/
|
||||||
|
|
||||||
|
if (!$adminOnly || Auth::user()->role == 'admin') {
|
||||||
|
echo $body;
|
||||||
}
|
}
|
||||||
notification('', 'modal-1', __('messages.Your security is at risk!'), '<b>' . __('messages.security.msg1') . '</b> ' . __('messages.security.msg2') . '<br><br>' . __('messages.security.msg3') . '<br><a href="' . url('admin/config#5') . '">' . __('messages.security.msg3') . '</a>.');
|
|
||||||
notification('hide-star-notification', 'modal-star', __('messages.Support Linkstack'), '' . __('messages.support.msg1') . ' <a target="_blank" href="https://github.com/linkstackorg/linkstack">' . __('messages.support.msg2') . '</a>. ' . __('messages.support.msg3') . '<br><br>' . __('messages.support.msg4') . ' <a target="_blank" href="https://linkstack.org/donate">' . __('messages.support.msg5') . '<br><br>' . __('messages.support.msg6') . '');
|
}
|
||||||
|
notification(true, '', 'modal-1', __('messages.Your security is at risk!'), '<b>' . __('messages.security.msg1') . '</b> ' . __('messages.security.msg2') . '<br><br>' . __('messages.security.msg3') . '<br><a href="' . url('admin/config#5') . '">' . __('messages.security.msg3') . '</a>.');
|
||||||
|
notification(true, 'hide-star-notification', 'modal-star', __('messages.Support Linkstack'), '' . __('messages.support.msg1') . ' <a target="_blank" href="https://github.com/linkstackorg/linkstack">' . __('messages.support.msg2') . '</a>. ' . __('messages.support.msg3') . '<br><br>' . __('messages.support.msg4') . ' <a target="_blank" href="https://linkstack.org/donate">' . __('messages.support.msg5') . '<br><br>' . __('messages.support.msg6') . '');
|
||||||
@endphp
|
@endphp
|
||||||
@endpush
|
@endpush
|
||||||
|
|
||||||
@if (auth()->user()->role == 'admin')
|
{{-- <! –– #### begin update detection #### ––> --}}
|
||||||
|
@if(auth()->user()->role == 'admin')
|
||||||
@push('sidebar-scripts')
|
@push('sidebar-scripts')
|
||||||
<script>
|
<script>
|
||||||
const isVisible = true;
|
const isVisible = true;
|
||||||
@ -681,10 +684,12 @@ MODAL; // Indentation breaks my code editor :/
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@endif
|
@endif
|
||||||
@endif
|
|
||||||
@endif
|
|
||||||
{{-- <! –– #### end update detection #### ––> --}}
|
{{-- <! –– #### end update detection #### ––> --}}
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
<li class="nav-item dropdown">
|
<li class="nav-item dropdown">
|
||||||
<a class="py-0 nav-link d-flex align-items-center dropdown-toggle" href="#"
|
<a class="py-0 nav-link d-flex align-items-center dropdown-toggle" href="#"
|
||||||
id="navbarDropdown" role="button" data-bs-toggle="dropdown"
|
id="navbarDropdown" role="button" data-bs-toggle="dropdown"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user