dachcom-digital / pimcore-members

Pimcore Object, Asset and Document Restriction & Frontend Authentication
Other
54 stars 34 forks source link

[RoleOptionsProvider] Default Role not visible in MembersGroup object #201

Closed scrummer closed 1 month ago

scrummer commented 3 months ago
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no

In RoleOptionsProvider:49 the ROLE_USER-role is proposed as default role to be available for all group objects. This method tho is never called and therefore there are no available roles to associate with groups (unless you configure some explicitly).

With no roles configured

security:    
    role_hierarchy:
        # Pimcore admin  // DO NOT CHANGE!
        ROLE_PIMCORE_ADMIN: [ROLE_PIMCORE_USER]

Result: image

With a user-defined role

security:
    role_hierarchy:
        # Pimcore admin  // DO NOT CHANGE!
        ROLE_PIMCORE_ADMIN: [ROLE_PIMCORE_USER]
        SOME_SPECIAL_ROLE: [ROLE_USER]

Result: image

scrummer commented 3 months ago

For reference https://github.com/pimcore/pimcore/blob/11.x/models/DataObject/ClassDefinition/DynamicOptionsProvider/MultiSelectOptionsProviderInterface.php#L21

I guess we should switch from MultiSelectOptionsProviderInterface to SelectOptionsProviderInterface since it was deprecated and there the getDefaultValue method is defined by the interface.