1
0
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:
Hillel Coren 2016-04-30 21:55:15 +03:00
parent a9e10985a1
commit 50de2d757e
2 changed files with 3 additions and 6 deletions

View File

@ -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);

View File

@ -11,7 +11,7 @@ class ClientRequest extends BaseRequest {
public function authorize()
{
return true;
return $this->user()->can('view', $this->entity());
}
/**