mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Merge remote-tracking branch 'origin/v3' into v3-master
This commit is contained in:
commit
02a9394cd9
|
@ -695,9 +695,7 @@ class AssetsController extends Controller
|
|||
$asset = Asset::find($assetId);
|
||||
$size = Helper::barcodeDimensions($settings->barcode_type);
|
||||
|
||||
if (!Company::isCurrentUserHasAccess($asset)) {
|
||||
return redirect()->to('hardware')->with('error', trans('general.insufficient_permissions'));
|
||||
}
|
||||
|
||||
|
||||
if (isset($asset->id,$asset->asset_tag)) {
|
||||
$barcode = new \Com\Tecnick\Barcode\Barcode();
|
||||
|
@ -724,9 +722,6 @@ class AssetsController extends Controller
|
|||
$settings = Setting::getSettings();
|
||||
$asset = Asset::find($assetId);
|
||||
|
||||
if (!Company::isCurrentUserHasAccess($asset)) {
|
||||
return redirect()->to('hardware')->with('error', trans('general.insufficient_permissions'));
|
||||
}
|
||||
|
||||
if (isset($asset->id,$asset->asset_tag)) {
|
||||
$barcode = new \Com\Tecnick\Barcode\Barcode();
|
||||
|
|
|
@ -338,6 +338,7 @@ class SettingsController extends Controller
|
|||
|
||||
$setting->locale = e(Input::get('locale', 'en'));
|
||||
$setting->qr_code = e(Input::get('qr_code', '0'));
|
||||
$setting->full_multiple_companies_support = e(Input::get('full_multiple_companies_support', '0'));
|
||||
$setting->alt_barcode = e(Input::get('alt_barcode'));
|
||||
$setting->alt_barcode_enabled = e(Input::get('alt_barcode_enabled', '0'));
|
||||
$setting->barcode_type = e(Input::get('barcode_type'));
|
||||
|
|
|
@ -3,6 +3,7 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
use Auth;
|
||||
|
||||
/**
|
||||
* Model for Companies.
|
||||
|
@ -108,7 +109,7 @@ final class Company extends Model
|
|||
|
||||
public static function isCurrentUserAuthorized()
|
||||
{
|
||||
return (!static::isFullMultipleCompanySupportEnabled() || Auth::user()->company_id == null);
|
||||
return (!static::isFullMultipleCompanySupportEnabled() || (Auth::user()->company_id == null) || Auth::user()->isSuperUser());
|
||||
}
|
||||
|
||||
public static function canManageUsersCompanies()
|
||||
|
|
Loading…
Reference in a new issue