mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-13 12:51:05 +03:30
Publish Role
This commit is contained in:
@@ -1,43 +1,43 @@
|
||||
<?php␍
|
||||
␍
|
||||
namespace App\Policies;␍
|
||||
␍
|
||||
use App\User;␍
|
||||
use App\TestType;␍
|
||||
use Doctrine\Tests\Common\Inflector\InflectorTest;␍
|
||||
␍
|
||||
class TestTypePolicy␍
|
||||
{␍
|
||||
public function list(User $User)␍
|
||||
{␍
|
||||
if($User->hasRole('SuperAdmin|Admin'))␍
|
||||
return true;␍
|
||||
}␍
|
||||
public function delete(User $User, TestType $TestType)␍
|
||||
{␍
|
||||
if($User->hasRole('SuperAdmin|Admin') && $TestType->test_results->count() == 0)␍
|
||||
return true;␍
|
||||
}␍
|
||||
␍
|
||||
public function update(User $User, TestType $TestType)␍
|
||||
{␍
|
||||
if($User->hasRole('SuperAdmin|Admin') && $TestType->test_results->count() == 0)␍
|
||||
return true;␍
|
||||
}␍
|
||||
␍
|
||||
public function store(User $User)␍
|
||||
{␍
|
||||
if($User->hasRole('SuperAdmin|Admin'))␍
|
||||
return true;␍
|
||||
}␍
|
||||
public function getInputs(User $User)␍
|
||||
{␍
|
||||
// if($User->hasRole('Admin'))␍
|
||||
return true;␍
|
||||
}␍
|
||||
public function generateBarcode(User $User, TestType $TestType)␍
|
||||
{␍
|
||||
if($User->hasRole('SuperAdmin|Admin'))␍
|
||||
return true;␍
|
||||
}␍
|
||||
}␍
|
||||
<?php
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\User;
|
||||
use App\TestType;
|
||||
use Doctrine\Tests\Common\Inflector\InflectorTest;
|
||||
|
||||
class TestTypePolicy
|
||||
{
|
||||
public function list(User $User)
|
||||
{
|
||||
if($User->hasRole('Admin'))
|
||||
return true;
|
||||
}
|
||||
public function delete(User $User, TestType $TestType)
|
||||
{
|
||||
if($User->hasRole('Admin') )
|
||||
return true;
|
||||
}
|
||||
|
||||
public function update(User $User, TestType $TestType)
|
||||
{
|
||||
if($User->hasRole('Admin') && $TestType->test_results->count() == 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
public function store(User $User)
|
||||
{
|
||||
if($User->hasRole('Admin'))
|
||||
return true;
|
||||
}
|
||||
public function getInputs(User $User)
|
||||
{
|
||||
// if($User->hasRole('Admin'))
|
||||
return true;
|
||||
}
|
||||
public function generateBarcode(User $User, TestType $TestType)
|
||||
{
|
||||
if($User->hasRole('Admin'))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user