Closed syeikhanugrah closed 2 years ago
Hi! What you can do, is change the returned array of fields when defining settings fields.
Like so:
\OptimistDigital\NovaSettings\NovaSettings::addSettingsFields(function() {
return user()->isAdmin() ? [
Text::make('Some setting', 'some_setting'),
Number::make('A number', 'a_number'),
] : [];
});
Theoretically, Nova's default authorization should work as well. Ie calling ->canSee(fn() => user()->isAdmin())
per field.
It would be great if user have separate nova-settings. Thanks for your great tool!