Settings for ModuleDefinitions #1829
Replies: 2 comments 6 replies
-
@leigh-pointer the Settings area in Oqtane was architected in a generic manner so that it can be used as an attribute store for any entity - core or third party. The SettingService provides a convenient wrapper for the most common core entities, and I think adding support for ModuleDefinition makes sense. In addition to the methods outlined above you will need to add some logic to the SettingController in the IsAuthorized method to ensure that only users in the Host role are able to access these methods. |
Beta Was this translation helpful? Give feedback.
-
It should require very minimal code changes to enable this if you follow the existing patterns. And the shared enum EntityNames already contains ModuleDefinition. |
Beta Was this translation helpful? Give feedback.
-
I think a nice extension to the ISettingService would be the ability to Add Update settings for the ModuleDefinition. These settings are regardless to the module instance but more for the module itself. i.e.. for a ExternMod i want to create some settings, these settings are used for all instances of the module.
SettingService.GetModuleDefinitionSettingsAsync(ModuleState.ModuleDefinition.ModuleDefinitionId);
await SettingService.UpdateModuleDefinitionSettingsAsync(settings, ModuleState.ModuleDefinition.ModuleDefinitionId);
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions