Working on permissions
This commit is contained in:
parent
a9e10985a1
commit
50de2d757e
2 changed files with 3 additions and 6 deletions
|
|
@ -95,12 +95,9 @@ class ClientController extends BaseController
|
|||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function show($publicId)
|
||||
public function show(ClientRequest $request)
|
||||
{
|
||||
//$client = $request->entity()->load('conacts');
|
||||
$client = Client::withTrashed()->scope($publicId)->with('contacts', 'size', 'industry')->firstOrFail();
|
||||
|
||||
$this->authorize('view', $client);
|
||||
$client = $request->entity();
|
||||
|
||||
$user = Auth::user();
|
||||
Utils::trackViewed($client->getDisplayName(), ENTITY_CLIENT);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class ClientRequest extends BaseRequest {
|
|||
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
return $this->user()->can('view', $this->entity());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue