Merge branch 'develop'

# Conflicts:
#	config/version.php
This commit is contained in:
snipe 2018-01-19 17:53:15 -08:00
commit cbca126d9d
7 changed files with 67 additions and 6 deletions

View file

@ -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

17
.github/stale.yml vendored Normal file
View file

@ -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

View file

@ -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;

View file

@ -0,0 +1,13 @@
<?php
namespace App\Policies;
use App\Policies\SnipePermissionsPolicy;
class CompanyPolicy extends SnipePermissionsPolicy
{
protected function columnName()
{
return 'companies';
}
}

View file

@ -15,6 +15,7 @@ use App\Models\Location;
use App\Models\Statuslabel;
use App\Models\Supplier;
use App\Models\Manufacturer;
use App\Models\Company;
use App\Models\User;
use App\Policies\AccessoryPolicy;
use App\Policies\AssetModelPolicy;
@ -30,6 +31,7 @@ use App\Policies\StatuslabelPolicy;
use App\Policies\SupplierPolicy;
use App\Policies\UserPolicy;
use App\Policies\ManufacturerPolicy;
use App\Policies\CompanyPolicy;
use Carbon\Carbon;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
@ -59,6 +61,7 @@ class AuthServiceProvider extends ServiceProvider
Supplier::class => 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);
});
}

View file

@ -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,
),
),

View file

@ -1,10 +1,10 @@
<?php
return array (
'app_version' => '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' => 'master',
);