Addd DisableDevices permission
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
|
||||
<li class="" ><a href="<?=self::getUrl("Pop")?>"><i class="fadr fa-fw fa-house text-info"></i> Pops</a></li>
|
||||
<?php endif; ?>
|
||||
<?php if($me->is(["Admin"]) || ($me->is("netowner","lineplanner","pipeplanner","pipeworker","lineworker","salespartner"))): ?>
|
||||
<?php if(($me->is(["Admin"]) || $me->is("netowner")) && !$me->can("DevicesDisabled")): ?>
|
||||
<li class=""><a href="<?=self::getUrl("Device")?>"><i class="fadr fa-fw fa-router text-info "></i> Devices</a></li>
|
||||
<?php endif; ?>
|
||||
<?php if($me->is(["Admin"])): ?>
|
||||
|
||||
@@ -264,7 +264,7 @@ class UserController extends mfBaseController
|
||||
|
||||
$canPermissions = [
|
||||
'Building', 'Pipework', 'Linework', 'Patching', 'Filestore',
|
||||
'Cpeprovisioning', 'Cpeshipping', 'Voipnumbering', 'Preorder',
|
||||
'Cpeprovisioning', 'Cpeshipping', 'DevicesDisabled', 'Voipnumbering', 'Preorder',
|
||||
'Preorderpricing', 'PreorderpricingReadonly', 'Preorderbilling',
|
||||
'PreorderbillingReadonly', 'Order', 'Billing', 'Fibu', 'Statistics',
|
||||
'WarehouseAdmin', 'WarehouseEShop', 'WarehouseUser', 'ADBExtended',
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class WorkerPermissionAddDisableDevices extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("WorkerPermission");
|
||||
$table->addColumn("canDevicesDisabled", "enum", ["values" => 'false,true', "default" => "false", "after" => "canCpeshipping"]);
|
||||
$table->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table("WorkerPermission")->removeColumn("canDevicesDisabled")->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user