SettingsBundle icon indicating copy to clipboard operation
SettingsBundle copied to clipboard

settings per entity

Open juanolon opened this issue 9 years ago • 3 comments

Hey, nice bundle btw. i do have a question: i would like to have different settings per user. On my project, we use different entities per user group. And each of them has different settings. The user entity already implements the SettingsOwnerInterface interface and getSettingIdentifier() returns different id's per user type. But all settings with scope "user" are being show to all users.

So my question is, did i miss something? or is this the current behaviour of the scope "user"? if so, does adding a new config namespace to the scope "user", and then filter the settings per entity class would be a good approach? something like this:

dmishh_settings:
    settings:
        guide:
            scope: user
            namespace: 'My\Bundle\Entity\Student'
            validation:
                type: choice
                options:
                    choices:
                        - opt1
                        - opt2
                    required: false
                    expanded: true
                    attr:
                        class:  'form-group checkbox'
                    placeholder: false

juanolon avatar Feb 18 '16 12:02 juanolon

Hey. Sorry for the slow response. Have I understood you correctly that you have multiple user groups and each group got different set of settings?

Nyholm avatar Mar 12 '16 09:03 Nyholm

hi, no problem. if you mean "user groups" like, different entities pre user type, then yes :) well, i have already done a small patch. will send you a PR

juanolon avatar Mar 12 '16 09:03 juanolon

I remember that we've discussed the grouping before a while ago in #23 so maybe also take that into account.

rvanlaak avatar Mar 12 '16 10:03 rvanlaak