This topic contains 2 replies, has 2 voices, and was last updated by Madhur 8 years, 3 months ago.
- Topic
Hi,
I created a bundle and the entity as given in the documentation.
The bundle works perfectly for Admin user. When a user with Sales Manager role logs in, he is not able to view the datagrid. My custom entity ownership is Organization. I have given all the permissions for the custom entity to the Sales Manager role. In-spite of that the user is not able to view the records.
The logs show one thing:
12[2016-01-07 17:59:18] security.DEBUG: ACL found, permission granted. Voting to grant access. [] [][2016-01-07 17:59:18] security.DEBUG: ACL found, no ACE applicable. Voting to deny access. [] []When I check in the profiler, the sql statement that is executed has one “AND (1 = 0)” condition added to it. Now I dont know from where this “And” condition is being appended.
Let me show you the code:
The Entity Class (Excerpt):1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556/*** PartIndex** @ORM\Table(name="oro_ext_pgapartindex")* @ORM\Entity* @Config(* defaultValues={* "dataaudit"={* "auditable"=true* },* "entity"={* "icon"="",* },* "ownership"={* "owner_type"="ORGANIZATION",* "owner_field_name"="owner",* "owner_column_name"="owner_id",* },* "security"={* "type"="ACL"* }* }* )*/class PartIndex{/*** @var integer** @ORM\Column(name="id", type="integer")* @ORM\Id* @ORM\GeneratedValue(strategy="AUTO")*/private $id;/*** @var string** @ORM\Column(name="partindexcode", type="string", length=10)*/private $partindexcode;/*** @var string** @ORM\Column(name="partindexlabel", type="string", length=255)*/private $partindexlabel;/*** @var Organization** @ORM\ManyToOne(targetEntity="Oro\Bundle\OrganizationBundle\Entity\Organization")* @ORM\JoinColumn(name="owner_id", referencedColumnName="id", onDelete="SET NULL")*/private $owner;12345678910111213141516class PartIndexController extends Controller{/*** @Route("/", name="partindex.partindex_index")* @Template("PGAPartIndexBundle:PartIndex:index.html.twig")* @Acl(* id="partindex.partindex_index",* type="entity",* class="PGAPartIndexBundle:PartIndex",* permission="VIEW"* )*/public function indexAction(){return array('gridName' => 'partindex-grid');}and the datagrid.yml is
1234567891011121314151617181920212223datagrid:partindex-grid:source:acl_resource: partindex.partindex_indextype: ormquery:select:- v.id- v.partindexcode- v.partindexlabel- vo.namefrom:- { table: PGAPartIndexBundle:PartIndex, alias: v }join:inner:- { join: v.owner, alias:vo }columns:partindexcode:label: Codepartindexlabel:label: 'Label'name:label: 'Organization'So what is wrong? What is ACE?
The Sales Manager user is able to view the detail view, able to create and also delete the record. But the datagrid is giving problems.
Thanks and Regards,
Madhur
The forum ‘OroCRM – Programming Questions’ is closed to new topics and replies.