-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lock configuration #24
Comments
@therouv I was actually planning on building this, so could you re-open this issue? I think we should create an after plugin for this method; \Magento\Config\Model\Config\Reader\Source\Deployed\SettingChecker::isReadOnly. If the result of that method is This would probably involve extracting this logic into a separate class for reusability in both the Processors and this plugin. |
@peterjaap Alright, issue reopened 😄 I was wondering, though, if locking these values makes sense for every config option. It definitely makes sense for critical configuration options. But for non-critical configuration options, merchants/agencies/developers might want to quickly change them in the admin UI and deploy the new value via the next deployment (in their release cycle). So, maybe we should create a configuration option with which merchants/agencies/developers can decide if (and/or which, e.g. by path) config options they want to make "read-only"? |
@therouv yeah good idea, let's make this opt-in. What would be a way to configure this? A separate file? Or some notation in the already existing yaml, like append |
@peterjaap I'm not a big fan of appending something to the config paths. But since we support JSON+YAML, something like this – a specific child node – would also work / make sense: YAML: path/to/config:
locked: true # (or 0/1)
default:
0: 1
websites:
base: 0
test: 0 JSON: {
"path/to/config": {
"locked": true,
"default": {
"0": true
},
"websites": {
"base": false,
"test": false
}
}
} What do you think? Also, regarding naming: |
Yeah I like that approach! Although Magento calls it readonly in their codebase, the flag to acutally lock a config value is |
Sounds good! |
Great discussion, just checking out the module and the @therouv approach sounds great to me.
Wouldn't that be skipping the import if the setting is present in the By looking through the code i.m.h.o. the easiest way to realize the locking in |
@wilfriedwolf I think you wouldn't run into that problem if you only define the plugin for the |
Lock configuration options in system configuration when settings are maintained via this module.
The text was updated successfully, but these errors were encountered: