mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Working on permissions
This commit is contained in:
parent
a9e10985a1
commit
50de2d757e
@ -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…
Reference in New Issue
Block a user