mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for tests
This commit is contained in:
parent
e47c875d19
commit
31610560a7
@ -27,7 +27,6 @@ class GenericReportRequest extends Request
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
// return $this->checkAuthority();
|
||||
}
|
||||
|
||||
public function rules()
|
||||
@ -83,22 +82,11 @@ class GenericReportRequest extends Request
|
||||
|
||||
private function checkAuthority()
|
||||
{
|
||||
$this->error_message = ctrans('texts.authorization_failure');
|
||||
|
||||
/** @var \App\Models\User $user */
|
||||
$user = auth()->user();
|
||||
|
||||
if(Ninja::isHosted() && $user->account->isFreeHostedClient()){
|
||||
$this->error_message = ctrans('texts.upgrade_to_view_reports');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return $user->isAdmin() || $user->hasPermission('view_reports');
|
||||
|
||||
}
|
||||
|
||||
protected function failedAuthorization()
|
||||
{
|
||||
throw new AuthorizationException($this->error_message);
|
||||
}
|
||||
}
|
||||
|
4
tests/ci
4
tests/ci
@ -28,8 +28,8 @@ $tests = \Illuminate\Support\Str::of($process->getOutput())
|
||||
))
|
||||
->filter(fn (string $test) => !empty($test)) // Make sure there are no empty lines
|
||||
->unique() // We only need unique classes
|
||||
->split((int) getenv('CI_NODE_TOTAL')) // Split it into equally sized chunks
|
||||
->get((int) getenv('CI_NODE_INDEX')); // Get the index we need for this instance
|
||||
->split((int) getenv('CI_NODE_TOTAL',1)) // Split it into equally sized chunks
|
||||
->get((int) getenv('CI_NODE_INDEX',1)); // Get the index we need for this instance
|
||||
|
||||
/**
|
||||
* Run phpunit with a filter:
|
||||
|
Loading…
x
Reference in New Issue
Block a user