1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Add rules for adding users to hosted platform

This commit is contained in:
David Bomba 2021-06-09 19:57:03 +10:00
parent dd22f683fa
commit f4bfa6c0fd

View File

@ -18,6 +18,7 @@ use App\Http\ValidationRules\User\AttachableUser;
use App\Http\ValidationRules\ValidUserForCompany;
use App\Libraries\MultiDB;
use App\Models\User;
use App\Utils\Ninja;
use Illuminate\Validation\Rule;
class StoreUserRequest extends Request
@ -45,8 +46,7 @@ class StoreUserRequest extends Request
$rules['email'] = ['email', new AttachableUser()];
}
if (auth()->user()->company()->account->isFreeHostedClient()) {
if (Ninja::isHosted()) {
$rules['hosted_users'] = new CanAddUserRule(auth()->user()->company()->account);
}