Merge remote-tracking branch 'origin/develop'

This commit is contained in:
snipe 2016-07-28 12:51:01 -07:00
commit 0a73297f24

View file

@ -86,12 +86,18 @@ final class Company extends Model
} else { } else {
$current_user = Auth::user(); $current_user = Auth::user();
// Super users should be able to set a company to whatever they need
if ($current_user->isSuperUser()) {
return static::getIdFromInput($unescaped_input);
} else {
if ($current_user->company_id != null) { if ($current_user->company_id != null) {
return $current_user->company_id; return $current_user->company_id;
} else { } else {
return static::getIdFromInput($unescaped_input); return static::getIdFromInput($unescaped_input);
} }
} }
}
} }
public static function isCurrentUserHasAccess($companyable) public static function isCurrentUserHasAccess($companyable)