- Add status checker + admin secure packages + upgrade enum + add sentry + upgrade to sitemap generator + bump to CRMV2 - Set customer role enum and user role enum - Update customer migration to set roles - phpcbf - faker local to fr - update lang - composer update - bump laravel ui - Redo all user crud - npm bump - Create admin command - rearrange views - redo all auth system - redo customer pro bo
119 lines
3.5 KiB
PHP
119 lines
3.5 KiB
PHP
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\Customer;
|
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
|
|
|
class CustomerPolicy
|
|
{
|
|
use HandlesAuthorization;
|
|
|
|
/**
|
|
* Determine whether the user can view any models.
|
|
*
|
|
* @param \App\Models\Customer $customer
|
|
* @return \Illuminate\Auth\Access\Response|boolean
|
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.Found
|
|
*/
|
|
public function viewAny(Customer $customer)
|
|
{
|
|
// phpcs:enable
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can view the model.
|
|
*
|
|
* @param \App\Models\Customer $loggedcustomer
|
|
* @param \App\Models\Customer $customer
|
|
* @return \Illuminate\Auth\Access\Response|boolean
|
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
|
|
*/
|
|
public function view(Customer $loggedcustomer, Customer $customer)
|
|
{
|
|
// phpcs:enable
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can create models.
|
|
*
|
|
* @param \App\Models\Customer $loggedcustomer
|
|
* @return \Illuminate\Auth\Access\Response|boolean
|
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.Found
|
|
*/
|
|
public function create(Customer $loggedcustomer)
|
|
{
|
|
// phpcs:enable
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can update the model.
|
|
*
|
|
* @param \App\Models\Customer $loggedcustomer
|
|
* @param \App\Models\Customer $customer
|
|
* @return \Illuminate\Auth\Access\Response|boolean
|
|
*/
|
|
public function update(Customer $loggedcustomer, Customer $customer)
|
|
{
|
|
return $loggedcustomer->id !== null and $loggedcustomer->id === $customer->id;
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can delete the model.
|
|
*
|
|
* @param \App\Models\Customer $loggedcustomer
|
|
* @param \App\Models\Customer $customer
|
|
* @return \Illuminate\Auth\Access\Response|boolean
|
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
|
|
*/
|
|
public function delete(Customer $loggedcustomer, Customer $customer)
|
|
{
|
|
// phpcs:enable
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can restore the model.
|
|
*
|
|
* @param \App\Models\Customer $loggedcustomer
|
|
* @param \App\Models\Customer $customer
|
|
* @return \Illuminate\Auth\Access\Response|boolean
|
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
|
|
*/
|
|
public function restore(Customer $loggedcustomer, Customer $customer)
|
|
{
|
|
// phpcs:enable
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can permanently delete the model.
|
|
*
|
|
* @param \App\Models\Customer $loggedcustomer
|
|
* @param \App\Models\Customer $customer
|
|
* @return \Illuminate\Auth\Access\Response|boolean
|
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
|
|
*/
|
|
public function forceDelete(Customer $loggedcustomer, Customer $customer)
|
|
{
|
|
// phpcs:enable
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can permanently delete the model.
|
|
*
|
|
* @param \App\Models\Customer $loggedcustomer
|
|
* @param \App\Models\Customer $customer
|
|
* @return \Illuminate\Auth\Access\Response|boolean
|
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
|
|
*/
|
|
public function updatePassword(Customer $loggedcustomer, Customer $customer)
|
|
{
|
|
// phpcs:enable
|
|
return $this->update($loggedcustomer, $customer);
|
|
}
|
|
}
|