Skip to content

A free open source IT asset/license management system

reworked authorization to the blade

Godfrey Me484ce7d1d64
diff --git a/app/Livewire/SlackSettingsForm.php b/app/Livewire/SlackSettingsForm.php
index 11127c2182..86399fcea0 100644
--- a/app/Livewire/SlackSettingsForm.php
+++ b/app/Livewire/SlackSettingsForm.php
@@ -86,8 +86,6 @@ class SlackSettingsForm extends Component
if ($company) {
$this->company = $company;
}
- $this->authorizeWebhookManagement();
-
$this->webhook_text = [
'slack' => [
@@ -353,13 +351,6 @@ class SlackSettingsForm extends Component
return $this->company ?? Setting::getSettings();
}
- protected function authorizeWebhookManagement(): void
- {
- if ($this->company) {
- $this->authorize('update', $this->company);
- }
- }
-
protected function loadWebhookSettings(): void
{
$source = $this->webhookSource();
diff --git a/resources/views/companies/edit.blade.php b/resources/views/companies/edit.blade.php
index 312267ddf3..02cae5085b 100644
--- a/resources/views/companies/edit.blade.php
+++ b/resources/views/companies/edit.blade.php
@@ -74,10 +74,15 @@
/>
<x-input.image-upload :item="$item" :imagePath="app('companies_upload_path')" />
- <x-form.legend help_text="{{trans('general.integration_settings_help')}}">
- {{ trans('general.integration_settings') }}
- </x-form.legend>
- <livewire:slack-settings-form :company="$item"/>
+
+ @can('superuser')
+ <fieldset name="integration-settings">
+ <x-form.legend help_text="{{trans('general.integration_settings_help')}}">
+ {{ trans('general.integration_settings') }}
+ </x-form.legend>
+ <livewire:slack-settings-form :company="$item"/>
+ </fieldset>
+ @endcan
<fieldset name="color-preferences">
<x-form.legend help_text="{{ trans('general.tag_color_help') }}">