ActivityPolicy::class, Client::class => ClientPolicy::class, Company::class => CompanyPolicy::class, Design::class => DesignPolicy::class, Product::class => ProductPolicy::class, Invoice::class => InvoicePolicy::class, Credit::class => CreditPolicy::class, Payment::class => PaymentPolicy::class, RecurringInvoice::class => RecurringInvoicePolicy::class, RecurringQuote::class => RecurringQuotePolicy::class, Quote::class => QuotePolicy::class, User::class => UserPolicy::class, GroupSetting::class => GroupSettingPolicy::class, CompanyGateway::class => CompanyGatewayPolicy::class, TaxRate::class => TaxRatePolicy::class, Vendor::class => VendorPolicy::class, Expense::class => ExpensePolicy::class, ]; /** * Register any authentication / authorization services. * * @return void */ public function boot() { $this->registerPolicies(); /* Auth::provider('users', function ($app, array $config) { return new MultiDatabaseUserProvider($this->app['hash'], $config['model']); }); Auth::provider('contacts', function ($app, array $config) { return new MultiDatabaseUserProvider($this->app['hash'], $config['model']); }); */ Gate::define('view-list', function ($user, $entity) { $entity = strtolower(class_basename($entity)); return $user->hasPermission('view_' . $entity) || $user->isAdmin(); }); } }