diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index 083d399..3cc80b3 100644 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -65,7 +65,7 @@ return [ 'active' => true, 'permission' => [ 'module' => Controller::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::CREATE, 'state' => PermissionCategory::DRIVER, ], ], @@ -76,7 +76,7 @@ return [ 'active' => true, 'permission' => [ 'module' => Controller::NAME, - 'type' => PermissionType::READ, + 'type' => PermissionType::MODIFY, 'state' => PermissionCategory::DRIVER, ], ], @@ -90,8 +90,8 @@ return [ 'active' => true, 'permission' => [ 'module' => Controller::NAME, - 'type' => PermissionType::READ, - 'state' => PermissionCategory::VEHICLE, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::VEHICLE_NOTE, ], ], [ @@ -101,8 +101,8 @@ return [ 'active' => true, 'permission' => [ 'module' => Controller::NAME, - 'type' => PermissionType::READ, - 'state' => PermissionCategory::VEHICLE, + 'type' => PermissionType::MODIFY, + 'state' => PermissionCategory::VEHICLE_NOTE, ], ], ], @@ -115,8 +115,8 @@ return [ 'active' => true, 'permission' => [ 'module' => Controller::NAME, - 'type' => PermissionType::READ, - 'state' => PermissionCategory::DRIVER, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::DRIVER_NOTE, ], ], [ @@ -126,8 +126,8 @@ return [ 'active' => true, 'permission' => [ 'module' => Controller::NAME, - 'type' => PermissionType::READ, - 'state' => PermissionCategory::DRIVER, + 'type' => PermissionType::MODIFY, + 'state' => PermissionCategory::DRIVER_NOTE, ], ], ], diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 38204bc..4901fee 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -21,6 +21,9 @@ namespace Modules\FleetManagement\Controller; * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 + * + * @question Consider to make FleetManagement rely on EquipmentManagement (especially the attributes)? + * https://github.com/Karaka-Management/oms-FleetManagement/issues/3 */ final class ApiController extends Controller { diff --git a/Theme/Backend/driver-view.tpl.php b/Theme/Backend/driver-view.tpl.php index 3ec3452..20fa678 100644 --- a/Theme/Backend/driver-view.tpl.php +++ b/Theme/Backend/driver-view.tpl.php @@ -27,12 +27,15 @@ $driverStatus = DriverStatus::getConstants(); $driver = $this->data['driver'] ?? new NullDriver(); $driverImage = $this->data['driverImage'] ?? new NullMedia(); +$isNew = $driver->id === 0; + /** * @var \phpOMS\Views\View $this */ echo $this->data['nav']->render(); ?>