Bug description
i am currently trying to get Laravel Nova and Statamic to work with eloquent and after debugging for 5 hours I found one issue in the statamic AuthServiceProvider:
Gate::before(function ($user, $ability) {
return optional(User::fromUser($user))->isSuper() ? true : null;
});
This before hook also overrides gates defined in Laravel Nova, Telescope, Horizion, ...
Example of Novas default gate:
Gate::define('viewNova', function ($user) {
return in_array($user->email, [
'taylor@laravel.com',
]);
});
Can the before be wrapped in something to only be applied to statamics auth?
How to reproduce
If you need a demo repo with Statamic and Telescope for example I could set one up for you if needed.
Logs
No response
Environment
EnvironmentApplication Name: HPLaravel Version: 10.13.5PHP Version: 8.1.18Composer Version: 2.5.5Environment: stagingDebug Mode: ENABLEDURL: cms.testMaintenance Mode: OFFCacheConfig: NOT CACHEDEvents: NOT CACHEDRoutes: NOT CACHEDViews: CACHEDDriversBroadcasting: logCache: statamicDatabase: mysqlLogs: stack / singleMail: smtpQueue: syncSession: fileStatamicAddons: 0Antlers: runtimeStache Watcher: EnabledStatic Caching: DisabledVersion: 4.7.0 Solo
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
No response
Bug description
i am currently trying to get Laravel Nova and Statamic to work with eloquent and after debugging for 5 hours I found one issue in the statamic AuthServiceProvider:
This
beforehook also overrides gates defined in Laravel Nova, Telescope, Horizion, ...Example of Novas default gate:
Can the before be wrapped in something to only be applied to statamics auth?
How to reproduce
If you need a demo repo with Statamic and Telescope for example I could set one up for you if needed.
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
No response