feat(auth): implement authorization checks for database management
This commit is contained in:
@@ -45,12 +45,16 @@ class All extends Component
|
||||
|
||||
public function instantSave()
|
||||
{
|
||||
$this->authorize('manageEnvironment', $this->resource);
|
||||
try {
|
||||
$this->authorize('manageEnvironment', $this->resource);
|
||||
|
||||
$this->resource->settings->is_env_sorting_enabled = $this->is_env_sorting_enabled;
|
||||
$this->resource->settings->save();
|
||||
$this->sortEnvironmentVariables();
|
||||
$this->dispatch('success', 'Environment variable settings updated.');
|
||||
$this->resource->settings->is_env_sorting_enabled = $this->is_env_sorting_enabled;
|
||||
$this->resource->settings->save();
|
||||
$this->sortEnvironmentVariables();
|
||||
$this->dispatch('success', 'Environment variable settings updated.');
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
}
|
||||
|
||||
public function sortEnvironmentVariables()
|
||||
@@ -98,9 +102,8 @@ class All extends Component
|
||||
|
||||
public function submit($data = null)
|
||||
{
|
||||
$this->authorize('manageEnvironment', $this->resource);
|
||||
|
||||
try {
|
||||
$this->authorize('manageEnvironment', $this->resource);
|
||||
if ($data === null) {
|
||||
$this->handleBulkSubmit();
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user