Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/DomainsController.php
Show First 20 Lines • Show All 111 Lines • ▼ Show 20 Lines | class DomainsController extends Controller | ||||
* Get the information about the specified domain. | * Get the information about the specified domain. | ||||
* | * | ||||
* @param int $id Domain identifier | * @param int $id Domain identifier | ||||
* | * | ||||
* @return \Illuminate\Http\JsonResponse|void | * @return \Illuminate\Http\JsonResponse|void | ||||
*/ | */ | ||||
public function show($id) | public function show($id) | ||||
{ | { | ||||
$domain = Domain::withEnvTenant()->findOrFail($id); | $domain = Domain::withEnvTenantContext()->findOrFail($id); | ||||
// Only owner (or admin) has access to the domain | // Only owner (or admin) has access to the domain | ||||
if (!Auth::guard()->user()->canRead($domain)) { | if (!Auth::guard()->user()->canRead($domain)) { | ||||
return $this->errorResponse(403); | return $this->errorResponse(403); | ||||
} | } | ||||
$response = $domain->toArray(); | $response = $domain->toArray(); | ||||
Show All 18 Lines | class DomainsController extends Controller | ||||
* Fetch domain status (and reload setup process) | * Fetch domain status (and reload setup process) | ||||
* | * | ||||
* @param int $id Domain identifier | * @param int $id Domain identifier | ||||
* | * | ||||
* @return \Illuminate\Http\JsonResponse | * @return \Illuminate\Http\JsonResponse | ||||
*/ | */ | ||||
public function status($id) | public function status($id) | ||||
{ | { | ||||
$domain = Domain::withEnvTenant()->findOrFail($id); | $domain = Domain::withEnvTenantContext()->findOrFail($id); | ||||
// Only owner (or admin) has access to the domain | // Only owner (or admin) has access to the domain | ||||
if (!Auth::guard()->user()->canRead($domain)) { | if (!Auth::guard()->user()->canRead($domain)) { | ||||
return $this->errorResponse(403); | return $this->errorResponse(403); | ||||
} | } | ||||
$response = self::statusInfo($domain); | $response = self::statusInfo($domain); | ||||
▲ Show 20 Lines • Show All 218 Lines • Show Last 20 Lines |