From 484c47cef81a3040d31a77c6b70e3896cdcc7df4 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 19 Jan 2018 16:23:28 -0800 Subject: [PATCH 1/4] Added stale.yml to auto-close stale issues --- .github/stale.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000000..982f7d4db1 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,17 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: wontfix +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions! +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false From 2c722ffc4f25df519360f92901772134085a2ed1 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 19 Jan 2018 16:31:01 -0800 Subject: [PATCH 2/4] Fixed issue template with correct path to storage logs --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 11525cb702..b5f067cc68 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -29,7 +29,7 @@ - If a stacktrace is provided in the error, include that too. - Any errors that appear in your browser's error console. - Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo. -- Include any additional information you can find in `app/storage/logs` and your webserver's logs. +- Include any additional information you can find in `storage/logs` and your webserver's logs. - Include what you've done so far in the installation, and if you got any error messages along the way. - Indicate whether or not you've manually edited any data directly in the database From c242abb42e86e8ab0e3bf9d0606bbfc3c655cfb0 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 19 Jan 2018 17:51:28 -0800 Subject: [PATCH 3/4] Added Company policy to fix company deletion issue --- .../Transformers/CompaniesTransformer.php | 2 +- app/Policies/CompanyPolicy.php | 13 +++++++++ app/Providers/AuthServiceProvider.php | 4 +++ config/permissions.php | 27 +++++++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 app/Policies/CompanyPolicy.php diff --git a/app/Http/Transformers/CompaniesTransformer.php b/app/Http/Transformers/CompaniesTransformer.php index e4e8a48711..96951bdf85 100644 --- a/app/Http/Transformers/CompaniesTransformer.php +++ b/app/Http/Transformers/CompaniesTransformer.php @@ -38,7 +38,7 @@ class CompaniesTransformer $permissions_array['available_actions'] = [ 'update' => Gate::allows('update', Company::class) ? true : false, - 'delete' => (Gate::allows('delete', Category::class) && ($company->assets_count == 0) && ($company->accessories_count == 0) && ($company->consumables_count == 0) && ($company->components_count == 0) && ($company->users_count == 0)) ? true : false, + 'delete' => (Gate::allows('delete', Company::class) && ($company->assets_count == 0) && ($company->accessories_count == 0) && ($company->consumables_count == 0) && ($company->components_count == 0) && ($company->users_count == 0)) ? true : false, ]; $array += $permissions_array; diff --git a/app/Policies/CompanyPolicy.php b/app/Policies/CompanyPolicy.php new file mode 100644 index 0000000000..7efcc99f3d --- /dev/null +++ b/app/Policies/CompanyPolicy.php @@ -0,0 +1,13 @@ + SupplierPolicy::class, User::class => UserPolicy::class, Manufacturer::class => ManufacturerPolicy::class, + Company::class => CompanyPolicy::class, ]; /** @@ -132,6 +135,7 @@ class AuthServiceProvider extends ServiceProvider || $user->can('view', \App\Models\Location::class) || $user->can('view', \App\Models\Company::class) || $user->can('view', \App\Models\Manufacturer::class) + || $user->can('view', \App\Models\Company::class) || $user->can('view', \App\Models\Depreciation::class); }); } diff --git a/config/permissions.php b/config/permissions.php index 0337916c17..531c05d055 100644 --- a/config/permissions.php +++ b/config/permissions.php @@ -521,6 +521,33 @@ return array( ), ), + 'Companies' => array( + array( + 'permission' => 'companies.view', + 'label' => 'View ', + 'note' => '', + 'display' => true, + ), + array( + 'permission' => 'companies.create', + 'label' => 'Create ', + 'note' => '', + 'display' => true, + ), + array( + 'permission' => 'companies.edit', + 'label' => 'Edit ', + 'note' => '', + 'display' => true, + ), + array( + 'permission' => 'companies.delete', + 'label' => 'Delete ', + 'note' => '', + 'display' => true, + ), + ), + From a9ffe8d210d9fefb90ea8d9f8a871e7666aa7225 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 19 Jan 2018 17:52:40 -0800 Subject: [PATCH 4/4] Bumped hash --- config/version.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/version.php b/config/version.php index f5bfb2b4e8..ebb53d2664 100644 --- a/config/version.php +++ b/config/version.php @@ -1,10 +1,10 @@ 'v4.1.10-pre', - 'full_app_version' => 'v4.1.10-pre - build 3215-gf08bec6', - 'build_version' => '3215', + 'full_app_version' => 'v4.1.10-pre - build 3219-gf38dc37', + 'build_version' => '3219', 'prerelease_version' => '', - 'hash_version' => 'gf08bec6', - 'full_hash' => 'v4.1.10-pre-85-gf08bec6', + 'hash_version' => 'gf38dc37', + 'full_hash' => 'v4.1.10-pre-89-gf38dc37', 'branch' => 'develop', );