OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums OroPlatform OroSecurityBundle: How to override an AbstractAclExtension?

This topic contains 2 replies, has 2 voices, and was last updated by  Frank 2 months, 1 week ago.

  • Creator
    Topic
  • #40352

    Frank
    Participant

    Hi there,

    I want to modify (override one method):

    OroSecurityBundle/Acl/Extension/AbstractAccessLevelAclExtension.php

    What I have done:

    1) have extended OroSecurityBundle with custom MySecurityBundle.

    2) have built an extension class:

    3) Registerd the extension class as a service:

    Obviously I missed some arguments for my service. But extended class does not use any.

    Furthermore I am not sure, is this the right way to extend an abstract class?

    Thank you for some recommandation in which direction I have to go …!

    Kind regards
    Frank

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #40359
    Andrey Yatsenko
    Andrey Yatsenko
    Moderator

    Hi Frank,

    This is probably not the right class to extend and you should go deeper to the voter level as customization fo this extension can break the whole security engine.

    But anyway, if you decided to override the class, consider overriding the concrete ACL extensions by defining the service with the same name as the original one, so at the end, you will override all the concrete classes extended from the abstract.

    #40366

    Frank
    Participant

    Hi,

    I’d suspected something like that.

    However, my thoughts are:

    1) It does not make very much sense to solve my problem on voter-level, as I would have to code the very similar functionality once again, which is domiciled in ‘AbstractAccessLevelAclExtension’ already.
    My customization is 1 line code only, to be added.

    2) Overriding a concrete class which extends ‘AbstractAccessLevelAclExtension’ does not solve my problem, as it does not touch the parent abstract Class (‘AbstractAccessLevelAclExtension’) method, I want to modify.
    (Hoping, I understand Andrey’s recommandation correctly).

    The only way could be to extend ‘AbstractAccessLevelAclExtension’ itself with a class called ‘AbstractAccessLevelAclExtension2’ for example , and register ‘AbstractAccessLevelAclExtension2’ under the same ‘id’ in service.yml as ‘AbstractAccessLevelAclExtension’ has.

    BUT ‘AbstractAccessLevelAclExtension’ is not registered as a service, and does not have a container-definition-id!

    I don’t want to modify oro’s core code at all! Furthermore the code of the securityBundle …

    Any idea, what I can do?

    Thanks a lot
    Frank

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

You will be redirected to [title]. Would you like to continue?

Yes No