mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
e3e4b490b0
# Conflicts: # resources/views/partials/header.blade.php # routes/web.php
46 lines
819 B
PHP
46 lines
819 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Segments\Standards\Rules;
|
|
|
|
use App\Classes\General\Abstracts\AbstractRule;
|
|
use App\Classes\Modules\Segments\DataTransferObjects\SegmentObject;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class CanDeleteSegment extends AbstractRule
|
|
{
|
|
/**
|
|
* @return bool
|
|
*/
|
|
protected function authorized(): bool
|
|
{
|
|
// TODO Set Authorization rules
|
|
|
|
if (!Auth::user()->can('delete segment')) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
/**
|
|
* @param SegmentObject $object
|
|
* @return bool
|
|
*/
|
|
protected function validators($object): bool
|
|
{
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
* @param SegmentObject $object
|
|
* @return bool
|
|
*/
|
|
protected function criteria($object): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
} |