mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 12:44:31 -04:00
Working on permissions
This commit is contained in:
parent
a9e10985a1
commit
50de2d757e
@ -95,12 +95,9 @@ class ClientController extends BaseController
|
|||||||
* @param int $id
|
* @param int $id
|
||||||
* @return Response
|
* @return Response
|
||||||
*/
|
*/
|
||||||
public function show($publicId)
|
public function show(ClientRequest $request)
|
||||||
{
|
{
|
||||||
//$client = $request->entity()->load('conacts');
|
$client = $request->entity();
|
||||||
$client = Client::withTrashed()->scope($publicId)->with('contacts', 'size', 'industry')->firstOrFail();
|
|
||||||
|
|
||||||
$this->authorize('view', $client);
|
|
||||||
|
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
Utils::trackViewed($client->getDisplayName(), ENTITY_CLIENT);
|
Utils::trackViewed($client->getDisplayName(), ENTITY_CLIENT);
|
||||||
|
@ -11,7 +11,7 @@ class ClientRequest extends BaseRequest {
|
|||||||
|
|
||||||
public function authorize()
|
public function authorize()
|
||||||
{
|
{
|
||||||
return true;
|
return $this->user()->can('view', $this->entity());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user