FEATURE: hopefully last changes about permissions

This commit is contained in:
Michal Kváček
2017-08-24 02:04:20 +02:00
parent b35149ad67
commit 49bd38db50
3 changed files with 12 additions and 18 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ class TemplatePolicy extends BasicPolicy
* *
* @return mixed * @return mixed
*/ */
public function copy(User $user, Template $template) public function copy(User $user)
{ {
return $user->hasAbility('copy-templates'); return $user->hasAbility('copy-templates');
} }
@@ -8,7 +8,7 @@
{{str_limit($template->description, 150)}} {{str_limit($template->description, 150)}}
</div> </div>
@can('copy', $template) @can('copy', \App\Models\Templates\Template::class)
@if($isWritable) @if($isWritable)
<a data-template-id="{{$template->id}}" data-template-name="{{$template->template_name}}" <a data-template-id="{{$template->id}}" data-template-name="{{$template->template_name}}"
class="btn btn-pill-left btn-secondary col-lg-6 copy-template" data-toggle="tooltip" class="btn btn-pill-left btn-secondary col-lg-6 copy-template" data-toggle="tooltip"
@@ -21,11 +21,6 @@
<i class="fa fa-copy"></i> <i class="fa fa-copy"></i>
</a> </a>
@endif @endif
@else
<a href="#" class="btn btn-pill-left btn-secondary disabled col-lg-6" data-toggle="tooltip"
title="@lang('admin/templates.cannotCopy')">
<i class="fa fa-copy"></i>
</a>
@endcan @endcan
@can('update', $template) @can('update', $template)
<a href="{{route('templates.edit', ['id' => $template->id])}}" <a href="{{route('templates.edit', ['id' => $template->id])}}"
@@ -112,13 +112,12 @@
@endforeach @endforeach
</ul> </ul>
@can('manage', \App\Models\ActionLog\ActionLog::class)
<div class="text-center"> <div class="text-center">
<a href="{{route('log.overview', ['userId' => $user->id])}}" <a href="{{route('log.overview', ['userId' => $user->id])}}"
class="btn btn-secondary">@lang('admin/userManagement.moreUserActions')</a> class="btn btn-secondary">@lang('admin/userManagement.moreUserActions')</a>
</div> </div>
@endcan
@else @else
<div class="alert alert-info"> <div class="alert alert-info">
<em>@lang('admin/userManagement.noActions')</em> <em>@lang('admin/userManagement.noActions')</em>