Forums › Forums › OroCRM › OroCRM – Programming Questions › Custom entity role configuration
This topic contains 6 replies, has 3 voices, and was last updated by ummarfarooq87 4 years, 1 month ago.
Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
- CreatorTopic
- April 26, 2016 at 2:27 am #25182
I want display my custom entity in the role configuration.
Is it possible ?
- CreatorTopic
- AuthorReplies
- April 27, 2016 at 2:53 am #25183
I have define acl with annotation on my controller, following the instructions on this page to create simple CRUD.
– My entity does not appear in the role configuration
– I can’t use my bundle ( no navigation menu ) if i am not a user with ROLE_ADMIN. ( I think it is use by default ). Why ? I have configure acl for crud permission but nothing about role…
– How to deal with ownership type of an entity ? Is it needed to add a field owner to my entity and made the relation ? Then why this field is automaticaly added to my forms.
Really need help please.
April 28, 2016 at 7:34 am #25184I have tried so many time to clear cache, update entity config and some other stuff, nothing change…
I have reinstall use the command oro:install –force –drop-database, updated schema and loaded migration.
Now i have my entity in role configuration ! :)
I have change nothing in my code. I don’t know were was the problem.
I still don’t know how to works with ownership type and Role acces level.
April 28, 2016 at 8:10 am #25185Hi, @adriwan_kenoby.
Can you send your entity definition class?
April 29, 2016 at 6:04 am #25186Hi @Yurii
I began to understood, I ‘am now able to manage role configuration of my entities.
To see my code follow this link to gitlab
Is it necessary to add $owner in all entities which I want to manage role configuration via UI.
PHP1234567891011121314/*** @var Oro\Bundle\OrganizationBundle\Entity\BusinessUnit** @ORM\ManyToOne(targetEntity="Oro\Bundle\OrganizationBundle\Entity\BusinessUnit", cascade={"persist"})* @ORM\JoinColumn(name="business_unit_owner_id", referencedColumnName="id", onDelete="SET NULL")* @ConfigField(* defaultValues={* "importexport"={* "excluded"=true* }* }* )*/protected $owner;I have so many questions but its now about my forms and i will open another topic for that..
Thanks and regards for your replies and the time you spend to answer me.
April 29, 2016 at 6:32 am #25187Hi, @adriwan_kenoby.
You are right. ACL protected entity should contain owner and organization fields.
February 17, 2020 at 10:38 pm #41377Hi Team,
I have created Custom entity after that i run the cache clear and update entity config command and able to change the permission for some roles and one Role Manager when we change permission for that entity getting error like undefined offset .Please let me know any solution for this issue
Thanks and Regards,
Ummar - AuthorReplies
The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.