OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions ACL field to custom field

This topic contains 5 replies, has 2 voices, and was last updated by  William Radi 1 year, 3 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
  • #38441

    William Radi

    Hello Oro guys!

    I have some custom required fields added to Oro Account. I’d like to make these fields editable just for who has access to do it, but the default Oro behavior (disable the field) doesn’t work in my fields.

    Oro blocks the user, but doesn’t let to save to form. This error appear:


    how do I make my custom fields disabled too?

    Thanks guys!

    • This topic was modified 1 year, 4 months ago by  William Radi.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
  • #38449
    Andrey Yatsenko
    Andrey Yatsenko

    Looks like you have to hide the field manually when the user has no access. this can be done at the form type or form type extension. Here is an example


    William Radi

    That was a good exemple :D

    Thanks, Andrey!


    William Radi

    Hey, guys!

    Andrey’ solution worked well, but another field is not ok.
    Account field work_speciality must be required but not all users can update it when updating an Account.

    If I just try to take it out of the form type if access is not granted, another error appear to me when a unauthorized user tries to update the account:


    So, how do I make it work? In other words, if access is not granted, don’t show the field if the user is updating an account, but if access is granted, the field be required?

    Andrey Yatsenko
    Andrey Yatsenko

    The issue appears because you have required validation constraint (Assert) for the work_speciality field.

    The first option is removing the constraint. Then the field will be not required for all the users.

    The second solution is to use validation groups to make the constraint work only when the form is submitted by the user with access to the field, then the field will be required for that user, but not required for users who can’t edit it.
    See https://symfony.com/doc/3.4/validation/groups.html for more details.


    William Radi

    Ok, understood…
    Thanks a lot, man! I’ll try it! :D

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

The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.

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

Yes No