feat:adds ability to share portfolios

also includes basic permissions and authorization
This commit is contained in:
hackerESQ
2024-10-21 22:23:20 -05:00
parent 63c4c1c228
commit f93bfad3ce
18 changed files with 375 additions and 41 deletions
@@ -4,9 +4,12 @@ use App\Models\Portfolio;
use App\Models\Transaction;
use Illuminate\Support\Collection;
use Livewire\Volt\Component;
use Mary\Traits\Toast;
new class extends Component {
use Toast;
// props
public Collection $transactions;
public ?Portfolio $portfolio;
@@ -21,6 +24,11 @@ new class extends Component {
// methods
public function showTransactionDialog($transactionId)
{
if (!auth()->user()->can('fullAccess', $this->portfolio)) {
$this->error(__('You do not have permission to manage transactions for this portfolio'));
return;
}
$this->editingTransaction = Transaction::findOrFail($transactionId);
$this->dispatch('toggle-manage-transaction');
}