snipe-it/database/factories/UserFactory.php

388 lines
9.7 KiB
PHP
Raw Normal View History

Discussion: Moving to policies for controller based authorization (#3080) * Make delete routes work. We put a little form in the modal that spoofs the delete field. * Fix route on creating a user. * Fix redundant id parameter. * Port acceptance tests to new urls. * Initial work on migrating to model based policies instead of global gates. Will allow for much more detailed permissions bits in the future. * This needs to stay for the dashboard checks. * Add user states for permissions to build tests. * Build up unit tests for gates/permissions. Move accessories/consumables/assets to policies instead of in authserviceprovider * Migrate various locations to new syntax. Update test to be more specific * Fix functional tests. Add an artisan command for installing a settings setup on travis-ci * Try a different id... Need to come up with a better way of passing the id for tests that need an existing one. * Try to fix travis * Update urls to use routes and not hardcode old paths. Also fix some migration errors found along the way.: * Add a environment for travis functional tests. * Adjust config file to make travis use it. * Use redirect()->route instead of redirect()-to * Dump all failures in the output directory if travis fails. * Cleanups and minor fixes. * Adjust the supplier modelfactory to comply with new validation restrictions. * Some test fixes. * Locales can be longer than 5 characters according to faker... fex gez_ET. Increase lenght in mysql and add a validation * Update test database dump to latest migrations.
2016-12-19 11:04:28 -08:00
<?php
2021-06-10 13:17:44 -07:00
namespace Database\Factories;
use App\Models\Company;
use App\Models\User;
2021-06-10 13:19:27 -07:00
use Illuminate\Database\Eloquent\Factories\Factory;
use \Auth;
2021-06-10 13:17:44 -07:00
class UserFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'activated' => 1,
'address' => $this->faker->address(),
'city' => $this->faker->city(),
'company_id' => Company::factory(),
'country' => $this->faker->country(),
2023-03-16 16:38:21 -07:00
'email' => $this->faker->safeEmail(),
2021-06-10 13:17:44 -07:00
'employee_num' => $this->faker->numberBetween(3500, 35050),
'first_name' => $this->faker->firstName(),
'jobtitle' => $this->faker->jobTitle(),
'last_name' => $this->faker->lastName(),
'locale' => 'en-US',
2021-06-10 13:17:44 -07:00
'notes' => 'Created by DB seeder',
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'permissions' => '{}',
2023-03-16 16:38:21 -07:00
'phone' => $this->faker->phoneNumber(),
'state' => $this->faker->stateAbbr(),
'username' => $this->faker->unique()->username(),
2023-03-16 16:38:21 -07:00
'zip' => $this->faker->postcode(),
2021-06-10 13:17:44 -07:00
];
}
public function deletedUser()
{
return $this->state(function () {
return [
'deleted_at' => $this->faker->dateTime(),
];
});
}
2021-06-10 13:17:44 -07:00
public function firstAdmin()
{
return $this->state(function () {
return [
'first_name' => 'Admin',
'last_name' => 'User',
'username' => 'admin',
'avatar' => '1.jpg',
2021-06-10 13:17:44 -07:00
'permissions' => '{"superuser":"1"}',
];
});
}
public function snipeAdmin()
{
return $this->state(function () {
return [
'first_name' => 'Snipe E.',
'last_name' => 'Head',
'username' => 'snipe',
'avatar' => '2.jpg',
2021-06-10 13:17:44 -07:00
'email' => 'snipe@snipe.net',
'permissions' => '{"superuser":"1"}',
];
});
}
public function testAdmin()
{
return $this->state(function () {
return [
'first_name' => 'Alison',
'last_name' => 'Gianotto',
'username' => 'agianotto@grokability.com',
'avatar' => '2.jpg',
'email' => 'agianotto@grokability.com',
'permissions' => '{"superuser":"1"}',
];
});
}
2021-06-10 13:17:44 -07:00
public function superuser()
{
return $this->appendPermission(['superuser' => '1']);
2021-06-10 13:17:44 -07:00
}
public function admin()
{
return $this->state(function () {
return [
'permissions' => '{"admin":"1"}',
'manager_id' => function () {
return User::where('permissions->superuser', '1')->first() ?? User::factory()->firstAdmin();
},
2021-06-10 13:17:44 -07:00
];
});
}
public function viewAssets()
{
return $this->appendPermission(['assets.view' => '1']);
2021-06-10 13:17:44 -07:00
}
public function createAssets()
{
return $this->appendPermission(['assets.create' => '1']);
2021-06-10 13:17:44 -07:00
}
public function editAssets()
{
return $this->appendPermission(['assets.edit' => '1']);
2021-06-10 13:17:44 -07:00
}
public function deleteAssets()
{
return $this->appendPermission(['assets.delete' => '1']);
2021-06-10 13:17:44 -07:00
}
public function checkinAssets()
{
return $this->appendPermission(['assets.checkin' => '1']);
2021-06-10 13:17:44 -07:00
}
public function checkoutAssets()
{
return $this->appendPermission(['assets.checkout' => '1']);
2021-06-10 13:17:44 -07:00
}
public function viewRequestableAssets()
{
return $this->appendPermission(['assets.view.requestable' => '1']);
2021-06-10 13:17:44 -07:00
}
Squashed commit of the following: commit dddbf27d780be4871ddbc401740f35a4561039a4 Author: snipe <snipe@snipe.net> Date: Wed Sep 18 14:18:52 2024 +0100 Updated language strings Signed-off-by: snipe <snipe@snipe.net> commit fcefcc8184b615bc9cdea9888e1f595f8fbc69b8 Merge: 04bb3eec8 3519a82dd Author: snipe <snipe@snipe.net> Date: Wed Sep 18 13:44:44 2024 +0100 Merge pull request #15512 from marcusmoore/testing/fmcs Added tests for delete methods in api commit 04bb3eec8308556c8e26166dfcae7ac7ec3aa446 Merge: 154d5d8d9 f963b9a19 Author: snipe <snipe@snipe.net> Date: Wed Sep 18 13:41:37 2024 +0100 Merge pull request #15521 from uberbrady/improve_country_selector Fix selected-index of Countries drop-down [fd-44144] commit f963b9a19f7b135a9141da34b1af0104a02ca5b3 Author: Brady Wetherington <bwetherington@grokability.com> Date: Wed Sep 18 13:24:26 2024 +0100 Fix selected-index of Countries drop-down commit 154d5d8d913fcea2bfc18ddff26ec874a21b5640 Merge: 6c996b775 9e5f6d656 Author: snipe <snipe@snipe.net> Date: Tue Sep 17 23:40:25 2024 +0100 Merge pull request #15491 from uberbrady/numeric_prefixes_add_multiple_assets [Fixes fd-43940] Improve multi-asset create when using numeric prefixes to asset_tags commit 3519a82dddedebfd518cbff61ddc1e1c979859fe Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 16:55:20 2024 -0700 Fix name: TestsFullMultipleCompaniesSupport commit a629df07bfc25da2e71a158a09cee9f5e3b1a612 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:49:08 2024 -0700 Implement interfaces on existing test classes commit 9a13fcab23f76a7336ffe58e38f269bfd3cea4cd Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:38:38 2024 -0700 Pluralize commit f5705a1dde7a736e167e27ec156f72351cfb47ec Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:34:55 2024 -0700 More unification commit f325c4afdb234ab4ba820caac45bdf599a550c2f Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:32:38 2024 -0700 Unify assertion method commit 1fddacd7d0440db2598c1d0e4aa0373de204bf53 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:25:11 2024 -0700 Re-order test methods commit 4af893df6189423edeb73d5239a12d4c7d5a68d0 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:20:24 2024 -0700 Improve assertions commit b8b3f91ce49e5d1829bcb2a84f4d145dc1701b29 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:55:18 2024 -0700 Formatting commit 7f40f55343fe7e801c6de0cd0d1fa63f442b8349 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:52:02 2024 -0700 Add tests for delete supplier endpoint commit b06e8d442d81b40e82ba70aaacf277eb5b5e075f Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:37:08 2024 -0700 Add tests for delete status label endpoint commit c269184c60e69b7aa319fedc5b4bbcb122677cb8 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:29:41 2024 -0700 Add tests for delete predefined kit endpoint commit 53c673dee21e9f8cb00904950ec66cb05bde6c55 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:13:12 2024 -0700 Add tests for delete manufacturer endpoint commit 50730fc4fba2519fb13799bc93ab682c10092c25 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 12:37:18 2024 -0700 Add tests for delete location endpoint commit 60a54cee797aa86e80c5abfe57699f263a85e841 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 12:33:30 2024 -0700 Add tests for delete license endpoint commit 446e962a503078e0c5fabef90aac7ada21ecb6e2 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:38:51 2024 -0700 Add tests for delete group endpoint commit 79a4bb73169445bb7a1e1e6bef4aff8a25dc1a12 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:35:44 2024 -0700 Add tests for delete depreciation endpoint commit 2f76c1bc5b5259cbb069356da8e8249a18910011 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:33:21 2024 -0700 Add assertion commit 38b9f4a43893f8c86e75d141a2ec41a7c2f90758 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:29:20 2024 -0700 Add tests for delete departments endpoint commit 3105f53afffdd78311314e970f6fe893e1162f8e Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:54:29 2024 -0700 Add tests for delete custom fieldsets endpoint commit 2047cfed09a231a90f1958ab0ce650808e05985d Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:20:32 2024 -0700 Add tests for delete custom fields endpoint commit e3268d32df495ed23e60c4c0587bd53fbb6d7485 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:00:02 2024 -0700 Add tests for delete consumable endpoint commit 6df8b0ac0e6936833bd93512c6a7e50c1f34091f Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 15:52:07 2024 -0700 Add tests for delete component endpoint commit 910f13c1f78fd2761c2c54ef8a560f80fdf611c6 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 15:38:30 2024 -0700 Add tests for delete companies endpoint commit 8ce2512f55a6c293c0d744932453a12cf48f7d6d Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:54:44 2024 -0700 Add tests for delete category endpoint commit 0ec415d4d018c0dfb5cd51f9abf01eaf62c4f0d3 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:46:22 2024 -0700 Clean up commit 2044570e95789a92ef705d02ca241216eb19d1e3 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:39:36 2024 -0700 Add tests for delete asset model endpoint commit b336c6273d57d6ca3181877ba844377cad5c6963 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:32:42 2024 -0700 Pluralize test classes commit 5299b3e9f066e1779312798ecb150786152cf254 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:29:44 2024 -0700 Remove code handled by CompanyableChildTrait commit 872b76b45fbdd41cb6e5ae149b158c83a97a6865 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:29:10 2024 -0700 Add tests for delete asset maintenance endpoint commit 275cf4630e6461ba2b22c846118ac1e2f352e989 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:16:37 2024 -0700 Add tests for delete asset endpoint commit 5c2660bd34873b3b9e7ef89990ea450f92ded381 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:02:32 2024 -0700 Introduce interface commit c7ae9d9dfa76b0efadf47695492761a8120439bf Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 12:58:47 2024 -0700 Add tests for delete accessory endpoint commit 9e5f6d656a5df14edae5e99be6b375b70b778950 Author: Brady Wetherington <bwetherington@grokability.com> Date: Wed Sep 11 15:45:01 2024 +0100 Improve multi-asset create when using numeric prefixes to asset_tags Signed-off-by: snipe <snipe@snipe.net>
2024-09-19 08:06:36 -07:00
public function deleteAssetModels()
{
return $this->appendPermission(['models.delete' => '1']);
}
2021-06-10 13:17:44 -07:00
public function viewAccessories()
{
return $this->appendPermission(['accessories.view' => '1']);
2021-06-10 13:17:44 -07:00
}
public function createAccessories()
{
return $this->appendPermission(['accessories.create' => '1']);
2021-06-10 13:17:44 -07:00
}
public function editAccessories()
{
return $this->appendPermission(['accessories.edit' => '1']);
2021-06-10 13:17:44 -07:00
}
public function deleteAccessories()
{
return $this->appendPermission(['accessories.delete' => '1']);
2021-06-10 13:17:44 -07:00
}
public function checkinAccessories()
{
return $this->appendPermission(['accessories.checkin' => '1']);
2021-06-10 13:17:44 -07:00
}
public function checkoutAccessories()
{
return $this->appendPermission(['accessories.checkout' => '1']);
2021-06-10 13:17:44 -07:00
}
public function viewConsumables()
{
return $this->appendPermission(['consumables.view' => '1']);
2021-06-10 13:17:44 -07:00
}
public function createConsumables()
{
return $this->appendPermission(['consumables.create' => '1']);
2021-06-10 13:17:44 -07:00
}
public function editConsumables()
{
return $this->appendPermission(['consumables.edit' => '1']);
2021-06-10 13:17:44 -07:00
}
public function deleteConsumables()
{
return $this->appendPermission(['consumables.delete' => '1']);
2021-06-10 13:17:44 -07:00
}
public function checkinConsumables()
{
return $this->appendPermission(['consumables.checkin' => '1']);
2021-06-10 13:17:44 -07:00
}
public function checkoutConsumables()
{
return $this->appendPermission(['consumables.checkout' => '1']);
2021-06-10 13:17:44 -07:00
}
Squashed commit of the following: commit dddbf27d780be4871ddbc401740f35a4561039a4 Author: snipe <snipe@snipe.net> Date: Wed Sep 18 14:18:52 2024 +0100 Updated language strings Signed-off-by: snipe <snipe@snipe.net> commit fcefcc8184b615bc9cdea9888e1f595f8fbc69b8 Merge: 04bb3eec8 3519a82dd Author: snipe <snipe@snipe.net> Date: Wed Sep 18 13:44:44 2024 +0100 Merge pull request #15512 from marcusmoore/testing/fmcs Added tests for delete methods in api commit 04bb3eec8308556c8e26166dfcae7ac7ec3aa446 Merge: 154d5d8d9 f963b9a19 Author: snipe <snipe@snipe.net> Date: Wed Sep 18 13:41:37 2024 +0100 Merge pull request #15521 from uberbrady/improve_country_selector Fix selected-index of Countries drop-down [fd-44144] commit f963b9a19f7b135a9141da34b1af0104a02ca5b3 Author: Brady Wetherington <bwetherington@grokability.com> Date: Wed Sep 18 13:24:26 2024 +0100 Fix selected-index of Countries drop-down commit 154d5d8d913fcea2bfc18ddff26ec874a21b5640 Merge: 6c996b775 9e5f6d656 Author: snipe <snipe@snipe.net> Date: Tue Sep 17 23:40:25 2024 +0100 Merge pull request #15491 from uberbrady/numeric_prefixes_add_multiple_assets [Fixes fd-43940] Improve multi-asset create when using numeric prefixes to asset_tags commit 3519a82dddedebfd518cbff61ddc1e1c979859fe Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 16:55:20 2024 -0700 Fix name: TestsFullMultipleCompaniesSupport commit a629df07bfc25da2e71a158a09cee9f5e3b1a612 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:49:08 2024 -0700 Implement interfaces on existing test classes commit 9a13fcab23f76a7336ffe58e38f269bfd3cea4cd Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:38:38 2024 -0700 Pluralize commit f5705a1dde7a736e167e27ec156f72351cfb47ec Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:34:55 2024 -0700 More unification commit f325c4afdb234ab4ba820caac45bdf599a550c2f Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:32:38 2024 -0700 Unify assertion method commit 1fddacd7d0440db2598c1d0e4aa0373de204bf53 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:25:11 2024 -0700 Re-order test methods commit 4af893df6189423edeb73d5239a12d4c7d5a68d0 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:20:24 2024 -0700 Improve assertions commit b8b3f91ce49e5d1829bcb2a84f4d145dc1701b29 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:55:18 2024 -0700 Formatting commit 7f40f55343fe7e801c6de0cd0d1fa63f442b8349 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:52:02 2024 -0700 Add tests for delete supplier endpoint commit b06e8d442d81b40e82ba70aaacf277eb5b5e075f Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:37:08 2024 -0700 Add tests for delete status label endpoint commit c269184c60e69b7aa319fedc5b4bbcb122677cb8 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:29:41 2024 -0700 Add tests for delete predefined kit endpoint commit 53c673dee21e9f8cb00904950ec66cb05bde6c55 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:13:12 2024 -0700 Add tests for delete manufacturer endpoint commit 50730fc4fba2519fb13799bc93ab682c10092c25 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 12:37:18 2024 -0700 Add tests for delete location endpoint commit 60a54cee797aa86e80c5abfe57699f263a85e841 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 12:33:30 2024 -0700 Add tests for delete license endpoint commit 446e962a503078e0c5fabef90aac7ada21ecb6e2 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:38:51 2024 -0700 Add tests for delete group endpoint commit 79a4bb73169445bb7a1e1e6bef4aff8a25dc1a12 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:35:44 2024 -0700 Add tests for delete depreciation endpoint commit 2f76c1bc5b5259cbb069356da8e8249a18910011 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:33:21 2024 -0700 Add assertion commit 38b9f4a43893f8c86e75d141a2ec41a7c2f90758 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:29:20 2024 -0700 Add tests for delete departments endpoint commit 3105f53afffdd78311314e970f6fe893e1162f8e Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:54:29 2024 -0700 Add tests for delete custom fieldsets endpoint commit 2047cfed09a231a90f1958ab0ce650808e05985d Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:20:32 2024 -0700 Add tests for delete custom fields endpoint commit e3268d32df495ed23e60c4c0587bd53fbb6d7485 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:00:02 2024 -0700 Add tests for delete consumable endpoint commit 6df8b0ac0e6936833bd93512c6a7e50c1f34091f Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 15:52:07 2024 -0700 Add tests for delete component endpoint commit 910f13c1f78fd2761c2c54ef8a560f80fdf611c6 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 15:38:30 2024 -0700 Add tests for delete companies endpoint commit 8ce2512f55a6c293c0d744932453a12cf48f7d6d Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:54:44 2024 -0700 Add tests for delete category endpoint commit 0ec415d4d018c0dfb5cd51f9abf01eaf62c4f0d3 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:46:22 2024 -0700 Clean up commit 2044570e95789a92ef705d02ca241216eb19d1e3 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:39:36 2024 -0700 Add tests for delete asset model endpoint commit b336c6273d57d6ca3181877ba844377cad5c6963 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:32:42 2024 -0700 Pluralize test classes commit 5299b3e9f066e1779312798ecb150786152cf254 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:29:44 2024 -0700 Remove code handled by CompanyableChildTrait commit 872b76b45fbdd41cb6e5ae149b158c83a97a6865 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:29:10 2024 -0700 Add tests for delete asset maintenance endpoint commit 275cf4630e6461ba2b22c846118ac1e2f352e989 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:16:37 2024 -0700 Add tests for delete asset endpoint commit 5c2660bd34873b3b9e7ef89990ea450f92ded381 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:02:32 2024 -0700 Introduce interface commit c7ae9d9dfa76b0efadf47695492761a8120439bf Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 12:58:47 2024 -0700 Add tests for delete accessory endpoint commit 9e5f6d656a5df14edae5e99be6b375b70b778950 Author: Brady Wetherington <bwetherington@grokability.com> Date: Wed Sep 11 15:45:01 2024 +0100 Improve multi-asset create when using numeric prefixes to asset_tags Signed-off-by: snipe <snipe@snipe.net>
2024-09-19 08:06:36 -07:00
public function deleteDepartments()
{
return $this->appendPermission(['departments.delete' => '1']);
}
public function viewDepartments()
{
return $this->appendPermission(['departments.view' => '1']);
}
2021-06-10 13:17:44 -07:00
public function viewLicenses()
{
return $this->appendPermission(['licenses.view' => '1']);
2021-06-10 13:17:44 -07:00
}
public function createLicenses()
{
return $this->appendPermission(['licenses.create' => '1']);
2021-06-10 13:17:44 -07:00
}
public function editLicenses()
{
return $this->appendPermission(['licenses.edit' => '1']);
2021-06-10 13:17:44 -07:00
}
public function deleteLicenses()
{
return $this->appendPermission(['licenses.delete' => '1']);
2021-06-10 13:17:44 -07:00
}
public function checkoutLicenses()
{
return $this->appendPermission(['licenses.checkout' => '1']);
2021-06-10 13:17:44 -07:00
}
public function viewKeysLicenses()
{
return $this->appendPermission(['licenses.keys' => '1']);
2021-06-10 13:17:44 -07:00
}
public function viewComponents()
{
return $this->appendPermission(['components.view' => '1']);
2021-06-10 13:17:44 -07:00
}
public function createComponents()
{
return $this->appendPermission(['components.create' => '1']);
2021-06-10 13:17:44 -07:00
}
public function editComponents()
{
return $this->appendPermission(['components.edit' => '1']);
2021-06-10 13:17:44 -07:00
}
public function deleteComponents()
{
return $this->appendPermission(['components.delete' => '1']);
2021-06-10 13:17:44 -07:00
}
public function checkinComponents()
{
return $this->appendPermission(['components.checkin' => '1']);
2021-06-10 13:17:44 -07:00
}
public function checkoutComponents()
{
return $this->appendPermission(['components.checkout' => '1']);
2021-06-10 13:17:44 -07:00
}
Squashed commit of the following: commit dddbf27d780be4871ddbc401740f35a4561039a4 Author: snipe <snipe@snipe.net> Date: Wed Sep 18 14:18:52 2024 +0100 Updated language strings Signed-off-by: snipe <snipe@snipe.net> commit fcefcc8184b615bc9cdea9888e1f595f8fbc69b8 Merge: 04bb3eec8 3519a82dd Author: snipe <snipe@snipe.net> Date: Wed Sep 18 13:44:44 2024 +0100 Merge pull request #15512 from marcusmoore/testing/fmcs Added tests for delete methods in api commit 04bb3eec8308556c8e26166dfcae7ac7ec3aa446 Merge: 154d5d8d9 f963b9a19 Author: snipe <snipe@snipe.net> Date: Wed Sep 18 13:41:37 2024 +0100 Merge pull request #15521 from uberbrady/improve_country_selector Fix selected-index of Countries drop-down [fd-44144] commit f963b9a19f7b135a9141da34b1af0104a02ca5b3 Author: Brady Wetherington <bwetherington@grokability.com> Date: Wed Sep 18 13:24:26 2024 +0100 Fix selected-index of Countries drop-down commit 154d5d8d913fcea2bfc18ddff26ec874a21b5640 Merge: 6c996b775 9e5f6d656 Author: snipe <snipe@snipe.net> Date: Tue Sep 17 23:40:25 2024 +0100 Merge pull request #15491 from uberbrady/numeric_prefixes_add_multiple_assets [Fixes fd-43940] Improve multi-asset create when using numeric prefixes to asset_tags commit 3519a82dddedebfd518cbff61ddc1e1c979859fe Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 16:55:20 2024 -0700 Fix name: TestsFullMultipleCompaniesSupport commit a629df07bfc25da2e71a158a09cee9f5e3b1a612 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:49:08 2024 -0700 Implement interfaces on existing test classes commit 9a13fcab23f76a7336ffe58e38f269bfd3cea4cd Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:38:38 2024 -0700 Pluralize commit f5705a1dde7a736e167e27ec156f72351cfb47ec Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:34:55 2024 -0700 More unification commit f325c4afdb234ab4ba820caac45bdf599a550c2f Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:32:38 2024 -0700 Unify assertion method commit 1fddacd7d0440db2598c1d0e4aa0373de204bf53 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:25:11 2024 -0700 Re-order test methods commit 4af893df6189423edeb73d5239a12d4c7d5a68d0 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:20:24 2024 -0700 Improve assertions commit b8b3f91ce49e5d1829bcb2a84f4d145dc1701b29 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:55:18 2024 -0700 Formatting commit 7f40f55343fe7e801c6de0cd0d1fa63f442b8349 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:52:02 2024 -0700 Add tests for delete supplier endpoint commit b06e8d442d81b40e82ba70aaacf277eb5b5e075f Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:37:08 2024 -0700 Add tests for delete status label endpoint commit c269184c60e69b7aa319fedc5b4bbcb122677cb8 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:29:41 2024 -0700 Add tests for delete predefined kit endpoint commit 53c673dee21e9f8cb00904950ec66cb05bde6c55 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:13:12 2024 -0700 Add tests for delete manufacturer endpoint commit 50730fc4fba2519fb13799bc93ab682c10092c25 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 12:37:18 2024 -0700 Add tests for delete location endpoint commit 60a54cee797aa86e80c5abfe57699f263a85e841 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 12:33:30 2024 -0700 Add tests for delete license endpoint commit 446e962a503078e0c5fabef90aac7ada21ecb6e2 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:38:51 2024 -0700 Add tests for delete group endpoint commit 79a4bb73169445bb7a1e1e6bef4aff8a25dc1a12 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:35:44 2024 -0700 Add tests for delete depreciation endpoint commit 2f76c1bc5b5259cbb069356da8e8249a18910011 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:33:21 2024 -0700 Add assertion commit 38b9f4a43893f8c86e75d141a2ec41a7c2f90758 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:29:20 2024 -0700 Add tests for delete departments endpoint commit 3105f53afffdd78311314e970f6fe893e1162f8e Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:54:29 2024 -0700 Add tests for delete custom fieldsets endpoint commit 2047cfed09a231a90f1958ab0ce650808e05985d Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:20:32 2024 -0700 Add tests for delete custom fields endpoint commit e3268d32df495ed23e60c4c0587bd53fbb6d7485 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:00:02 2024 -0700 Add tests for delete consumable endpoint commit 6df8b0ac0e6936833bd93512c6a7e50c1f34091f Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 15:52:07 2024 -0700 Add tests for delete component endpoint commit 910f13c1f78fd2761c2c54ef8a560f80fdf611c6 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 15:38:30 2024 -0700 Add tests for delete companies endpoint commit 8ce2512f55a6c293c0d744932453a12cf48f7d6d Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:54:44 2024 -0700 Add tests for delete category endpoint commit 0ec415d4d018c0dfb5cd51f9abf01eaf62c4f0d3 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:46:22 2024 -0700 Clean up commit 2044570e95789a92ef705d02ca241216eb19d1e3 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:39:36 2024 -0700 Add tests for delete asset model endpoint commit b336c6273d57d6ca3181877ba844377cad5c6963 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:32:42 2024 -0700 Pluralize test classes commit 5299b3e9f066e1779312798ecb150786152cf254 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:29:44 2024 -0700 Remove code handled by CompanyableChildTrait commit 872b76b45fbdd41cb6e5ae149b158c83a97a6865 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:29:10 2024 -0700 Add tests for delete asset maintenance endpoint commit 275cf4630e6461ba2b22c846118ac1e2f352e989 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:16:37 2024 -0700 Add tests for delete asset endpoint commit 5c2660bd34873b3b9e7ef89990ea450f92ded381 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:02:32 2024 -0700 Introduce interface commit c7ae9d9dfa76b0efadf47695492761a8120439bf Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 12:58:47 2024 -0700 Add tests for delete accessory endpoint commit 9e5f6d656a5df14edae5e99be6b375b70b778950 Author: Brady Wetherington <bwetherington@grokability.com> Date: Wed Sep 11 15:45:01 2024 +0100 Improve multi-asset create when using numeric prefixes to asset_tags Signed-off-by: snipe <snipe@snipe.net>
2024-09-19 08:06:36 -07:00
public function createCompanies()
{
return $this->appendPermission(['companies.create' => '1']);
}
public function deleteCompanies()
{
return $this->appendPermission(['companies.delete' => '1']);
}
2021-06-10 13:17:44 -07:00
public function viewUsers()
{
return $this->appendPermission(['users.view' => '1']);
2021-06-10 13:17:44 -07:00
}
public function createUsers()
{
return $this->appendPermission(['users.create' => '1']);
2021-06-10 13:17:44 -07:00
}
public function editUsers()
{
return $this->appendPermission(['users.edit' => '1']);
2021-06-10 13:17:44 -07:00
}
public function deleteUsers()
{
return $this->appendPermission(['users.delete' => '1']);
2021-06-10 13:17:44 -07:00
}
Squashed commit of the following: commit dddbf27d780be4871ddbc401740f35a4561039a4 Author: snipe <snipe@snipe.net> Date: Wed Sep 18 14:18:52 2024 +0100 Updated language strings Signed-off-by: snipe <snipe@snipe.net> commit fcefcc8184b615bc9cdea9888e1f595f8fbc69b8 Merge: 04bb3eec8 3519a82dd Author: snipe <snipe@snipe.net> Date: Wed Sep 18 13:44:44 2024 +0100 Merge pull request #15512 from marcusmoore/testing/fmcs Added tests for delete methods in api commit 04bb3eec8308556c8e26166dfcae7ac7ec3aa446 Merge: 154d5d8d9 f963b9a19 Author: snipe <snipe@snipe.net> Date: Wed Sep 18 13:41:37 2024 +0100 Merge pull request #15521 from uberbrady/improve_country_selector Fix selected-index of Countries drop-down [fd-44144] commit f963b9a19f7b135a9141da34b1af0104a02ca5b3 Author: Brady Wetherington <bwetherington@grokability.com> Date: Wed Sep 18 13:24:26 2024 +0100 Fix selected-index of Countries drop-down commit 154d5d8d913fcea2bfc18ddff26ec874a21b5640 Merge: 6c996b775 9e5f6d656 Author: snipe <snipe@snipe.net> Date: Tue Sep 17 23:40:25 2024 +0100 Merge pull request #15491 from uberbrady/numeric_prefixes_add_multiple_assets [Fixes fd-43940] Improve multi-asset create when using numeric prefixes to asset_tags commit 3519a82dddedebfd518cbff61ddc1e1c979859fe Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 16:55:20 2024 -0700 Fix name: TestsFullMultipleCompaniesSupport commit a629df07bfc25da2e71a158a09cee9f5e3b1a612 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:49:08 2024 -0700 Implement interfaces on existing test classes commit 9a13fcab23f76a7336ffe58e38f269bfd3cea4cd Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:38:38 2024 -0700 Pluralize commit f5705a1dde7a736e167e27ec156f72351cfb47ec Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:34:55 2024 -0700 More unification commit f325c4afdb234ab4ba820caac45bdf599a550c2f Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:32:38 2024 -0700 Unify assertion method commit 1fddacd7d0440db2598c1d0e4aa0373de204bf53 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:25:11 2024 -0700 Re-order test methods commit 4af893df6189423edeb73d5239a12d4c7d5a68d0 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:20:24 2024 -0700 Improve assertions commit b8b3f91ce49e5d1829bcb2a84f4d145dc1701b29 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:55:18 2024 -0700 Formatting commit 7f40f55343fe7e801c6de0cd0d1fa63f442b8349 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:52:02 2024 -0700 Add tests for delete supplier endpoint commit b06e8d442d81b40e82ba70aaacf277eb5b5e075f Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:37:08 2024 -0700 Add tests for delete status label endpoint commit c269184c60e69b7aa319fedc5b4bbcb122677cb8 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:29:41 2024 -0700 Add tests for delete predefined kit endpoint commit 53c673dee21e9f8cb00904950ec66cb05bde6c55 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:13:12 2024 -0700 Add tests for delete manufacturer endpoint commit 50730fc4fba2519fb13799bc93ab682c10092c25 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 12:37:18 2024 -0700 Add tests for delete location endpoint commit 60a54cee797aa86e80c5abfe57699f263a85e841 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 12:33:30 2024 -0700 Add tests for delete license endpoint commit 446e962a503078e0c5fabef90aac7ada21ecb6e2 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:38:51 2024 -0700 Add tests for delete group endpoint commit 79a4bb73169445bb7a1e1e6bef4aff8a25dc1a12 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:35:44 2024 -0700 Add tests for delete depreciation endpoint commit 2f76c1bc5b5259cbb069356da8e8249a18910011 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:33:21 2024 -0700 Add assertion commit 38b9f4a43893f8c86e75d141a2ec41a7c2f90758 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:29:20 2024 -0700 Add tests for delete departments endpoint commit 3105f53afffdd78311314e970f6fe893e1162f8e Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:54:29 2024 -0700 Add tests for delete custom fieldsets endpoint commit 2047cfed09a231a90f1958ab0ce650808e05985d Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:20:32 2024 -0700 Add tests for delete custom fields endpoint commit e3268d32df495ed23e60c4c0587bd53fbb6d7485 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:00:02 2024 -0700 Add tests for delete consumable endpoint commit 6df8b0ac0e6936833bd93512c6a7e50c1f34091f Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 15:52:07 2024 -0700 Add tests for delete component endpoint commit 910f13c1f78fd2761c2c54ef8a560f80fdf611c6 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 15:38:30 2024 -0700 Add tests for delete companies endpoint commit 8ce2512f55a6c293c0d744932453a12cf48f7d6d Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:54:44 2024 -0700 Add tests for delete category endpoint commit 0ec415d4d018c0dfb5cd51f9abf01eaf62c4f0d3 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:46:22 2024 -0700 Clean up commit 2044570e95789a92ef705d02ca241216eb19d1e3 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:39:36 2024 -0700 Add tests for delete asset model endpoint commit b336c6273d57d6ca3181877ba844377cad5c6963 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:32:42 2024 -0700 Pluralize test classes commit 5299b3e9f066e1779312798ecb150786152cf254 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:29:44 2024 -0700 Remove code handled by CompanyableChildTrait commit 872b76b45fbdd41cb6e5ae149b158c83a97a6865 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:29:10 2024 -0700 Add tests for delete asset maintenance endpoint commit 275cf4630e6461ba2b22c846118ac1e2f352e989 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:16:37 2024 -0700 Add tests for delete asset endpoint commit 5c2660bd34873b3b9e7ef89990ea450f92ded381 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:02:32 2024 -0700 Introduce interface commit c7ae9d9dfa76b0efadf47695492761a8120439bf Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 12:58:47 2024 -0700 Add tests for delete accessory endpoint commit 9e5f6d656a5df14edae5e99be6b375b70b778950 Author: Brady Wetherington <bwetherington@grokability.com> Date: Wed Sep 11 15:45:01 2024 +0100 Improve multi-asset create when using numeric prefixes to asset_tags Signed-off-by: snipe <snipe@snipe.net>
2024-09-19 08:06:36 -07:00
public function deleteCategories()
{
return $this->appendPermission(['categories.delete' => '1']);
}
public function deleteLocations()
{
return $this->appendPermission(['locations.delete' => '1']);
}
public function canEditOwnLocation()
{
return $this->appendPermission(['self.edit_location' => '1']);
}
public function canViewReports()
{
return $this->appendPermission(['reports.view' => '1']);
}
2024-07-15 15:49:18 -07:00
public function canImport()
{
return $this->appendPermission(['import' => '1']);
}
Squashed commit of the following: commit dddbf27d780be4871ddbc401740f35a4561039a4 Author: snipe <snipe@snipe.net> Date: Wed Sep 18 14:18:52 2024 +0100 Updated language strings Signed-off-by: snipe <snipe@snipe.net> commit fcefcc8184b615bc9cdea9888e1f595f8fbc69b8 Merge: 04bb3eec8 3519a82dd Author: snipe <snipe@snipe.net> Date: Wed Sep 18 13:44:44 2024 +0100 Merge pull request #15512 from marcusmoore/testing/fmcs Added tests for delete methods in api commit 04bb3eec8308556c8e26166dfcae7ac7ec3aa446 Merge: 154d5d8d9 f963b9a19 Author: snipe <snipe@snipe.net> Date: Wed Sep 18 13:41:37 2024 +0100 Merge pull request #15521 from uberbrady/improve_country_selector Fix selected-index of Countries drop-down [fd-44144] commit f963b9a19f7b135a9141da34b1af0104a02ca5b3 Author: Brady Wetherington <bwetherington@grokability.com> Date: Wed Sep 18 13:24:26 2024 +0100 Fix selected-index of Countries drop-down commit 154d5d8d913fcea2bfc18ddff26ec874a21b5640 Merge: 6c996b775 9e5f6d656 Author: snipe <snipe@snipe.net> Date: Tue Sep 17 23:40:25 2024 +0100 Merge pull request #15491 from uberbrady/numeric_prefixes_add_multiple_assets [Fixes fd-43940] Improve multi-asset create when using numeric prefixes to asset_tags commit 3519a82dddedebfd518cbff61ddc1e1c979859fe Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 16:55:20 2024 -0700 Fix name: TestsFullMultipleCompaniesSupport commit a629df07bfc25da2e71a158a09cee9f5e3b1a612 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:49:08 2024 -0700 Implement interfaces on existing test classes commit 9a13fcab23f76a7336ffe58e38f269bfd3cea4cd Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:38:38 2024 -0700 Pluralize commit f5705a1dde7a736e167e27ec156f72351cfb47ec Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:34:55 2024 -0700 More unification commit f325c4afdb234ab4ba820caac45bdf599a550c2f Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:32:38 2024 -0700 Unify assertion method commit 1fddacd7d0440db2598c1d0e4aa0373de204bf53 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:25:11 2024 -0700 Re-order test methods commit 4af893df6189423edeb73d5239a12d4c7d5a68d0 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 14:20:24 2024 -0700 Improve assertions commit b8b3f91ce49e5d1829bcb2a84f4d145dc1701b29 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:55:18 2024 -0700 Formatting commit 7f40f55343fe7e801c6de0cd0d1fa63f442b8349 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:52:02 2024 -0700 Add tests for delete supplier endpoint commit b06e8d442d81b40e82ba70aaacf277eb5b5e075f Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:37:08 2024 -0700 Add tests for delete status label endpoint commit c269184c60e69b7aa319fedc5b4bbcb122677cb8 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:29:41 2024 -0700 Add tests for delete predefined kit endpoint commit 53c673dee21e9f8cb00904950ec66cb05bde6c55 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 13:13:12 2024 -0700 Add tests for delete manufacturer endpoint commit 50730fc4fba2519fb13799bc93ab682c10092c25 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 12:37:18 2024 -0700 Add tests for delete location endpoint commit 60a54cee797aa86e80c5abfe57699f263a85e841 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 12:33:30 2024 -0700 Add tests for delete license endpoint commit 446e962a503078e0c5fabef90aac7ada21ecb6e2 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:38:51 2024 -0700 Add tests for delete group endpoint commit 79a4bb73169445bb7a1e1e6bef4aff8a25dc1a12 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:35:44 2024 -0700 Add tests for delete depreciation endpoint commit 2f76c1bc5b5259cbb069356da8e8249a18910011 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:33:21 2024 -0700 Add assertion commit 38b9f4a43893f8c86e75d141a2ec41a7c2f90758 Author: Marcus Moore <contact@marcusmoore.io> Date: Mon Sep 16 10:29:20 2024 -0700 Add tests for delete departments endpoint commit 3105f53afffdd78311314e970f6fe893e1162f8e Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:54:29 2024 -0700 Add tests for delete custom fieldsets endpoint commit 2047cfed09a231a90f1958ab0ce650808e05985d Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:20:32 2024 -0700 Add tests for delete custom fields endpoint commit e3268d32df495ed23e60c4c0587bd53fbb6d7485 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 16:00:02 2024 -0700 Add tests for delete consumable endpoint commit 6df8b0ac0e6936833bd93512c6a7e50c1f34091f Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 15:52:07 2024 -0700 Add tests for delete component endpoint commit 910f13c1f78fd2761c2c54ef8a560f80fdf611c6 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 15:38:30 2024 -0700 Add tests for delete companies endpoint commit 8ce2512f55a6c293c0d744932453a12cf48f7d6d Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:54:44 2024 -0700 Add tests for delete category endpoint commit 0ec415d4d018c0dfb5cd51f9abf01eaf62c4f0d3 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:46:22 2024 -0700 Clean up commit 2044570e95789a92ef705d02ca241216eb19d1e3 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:39:36 2024 -0700 Add tests for delete asset model endpoint commit b336c6273d57d6ca3181877ba844377cad5c6963 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:32:42 2024 -0700 Pluralize test classes commit 5299b3e9f066e1779312798ecb150786152cf254 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:29:44 2024 -0700 Remove code handled by CompanyableChildTrait commit 872b76b45fbdd41cb6e5ae149b158c83a97a6865 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:29:10 2024 -0700 Add tests for delete asset maintenance endpoint commit 275cf4630e6461ba2b22c846118ac1e2f352e989 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:16:37 2024 -0700 Add tests for delete asset endpoint commit 5c2660bd34873b3b9e7ef89990ea450f92ded381 Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 13:02:32 2024 -0700 Introduce interface commit c7ae9d9dfa76b0efadf47695492761a8120439bf Author: Marcus Moore <contact@marcusmoore.io> Date: Thu Sep 12 12:58:47 2024 -0700 Add tests for delete accessory endpoint commit 9e5f6d656a5df14edae5e99be6b375b70b778950 Author: Brady Wetherington <bwetherington@grokability.com> Date: Wed Sep 11 15:45:01 2024 +0100 Improve multi-asset create when using numeric prefixes to asset_tags Signed-off-by: snipe <snipe@snipe.net>
2024-09-19 08:06:36 -07:00
public function deleteCustomFields()
{
return $this->appendPermission(['customfields.delete' => '1']);
}
public function deleteCustomFieldsets()
{
return $this->appendPermission(['customfields.delete' => '1']);
}
public function deleteDepreciations()
{
return $this->appendPermission(['depreciations.delete' => '1']);
}
public function deleteManufacturers()
{
return $this->appendPermission(['manufacturers.delete' => '1']);
}
public function deletePredefinedKits()
{
return $this->appendPermission(['kits.delete' => '1']);
}
public function deleteStatusLabels()
{
return $this->appendPermission(['statuslabels.delete' => '1']);
}
public function deleteSuppliers()
{
return $this->appendPermission(['suppliers.delete' => '1']);
}
private function appendPermission(array $permission)
{
return $this->state(function ($currentState) use ($permission) {
return [
'permissions' => json_encode(
array_merge(
json_decode($currentState['permissions'], true),
$permission
)
),
];
});
}
public function deleted(): self
{
return $this->state(['deleted_at' => $this->faker->dateTime()]);
}
2021-06-10 13:17:44 -07:00
}