Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/UsersController.php
Show First 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | public static function statusInfo($user): array | ||||
->join('skus', 'skus.id', '=', 'entitlements.sku_id') | ->join('skus', 'skus.id', '=', 'entitlements.sku_id') | ||||
->get() | ->get() | ||||
->pluck('title') | ->pluck('title') | ||||
->sort() | ->sort() | ||||
->unique() | ->unique() | ||||
->values() | ->values() | ||||
->all(); | ->all(); | ||||
$hasBeta = in_array('beta', $skus); | |||||
$result = [ | $result = [ | ||||
'skus' => $skus, | 'skus' => $skus, | ||||
// TODO: This will change when we enable all users to create domains | // TODO: This will change when we enable all users to create domains | ||||
'enableDomains' => $isController && $hasCustomDomain, | 'enableDomains' => $isController && $hasCustomDomain, | ||||
// TODO: Make 'enableDistlists' working for wallet controllers that aren't account owners | // TODO: Make 'enableDistlists' working for wallet controllers that aren't account owners | ||||
'enableDistlists' => $isController && $hasCustomDomain && in_array('beta-distlists', $skus), | 'enableDistlists' => $isController && $hasCustomDomain && $hasBeta, | ||||
'enableFiles' => in_array('files', $skus), | 'enableFiles' => !$isDegraded && $hasBeta && \config('app.with_files'), | ||||
// TODO: Make 'enableFolders' working for wallet controllers that aren't account owners | // TODO: Make 'enableFolders' working for wallet controllers that aren't account owners | ||||
'enableFolders' => $isController && $hasCustomDomain && in_array('beta-shared-folders', $skus), | 'enableFolders' => $isController && $hasCustomDomain && $hasBeta, | ||||
// TODO: Make 'enableResources' working for wallet controllers that aren't account owners | // TODO: Make 'enableResources' working for wallet controllers that aren't account owners | ||||
'enableResources' => $isController && $hasCustomDomain && in_array('beta-resources', $skus), | 'enableResources' => $isController && $hasCustomDomain && $hasBeta, | ||||
'enableRooms' => !$isDegraded, | |||||
'enableSettings' => $isController, | 'enableSettings' => $isController, | ||||
'enableUsers' => $isController, | 'enableUsers' => $isController, | ||||
'enableWallets' => $isController, | 'enableWallets' => $isController, | ||||
'enableCompanionapps' => $isController && in_array('beta', $skus), | 'enableCompanionapps' => $hasBeta, | ||||
]; | ]; | ||||
return array_merge($process, $result); | return array_merge($process, $result); | ||||
} | } | ||||
/** | /** | ||||
* Create a new user record. | * Create a new user record. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 560 Lines • Show Last 20 Lines |