This topic contains 1 reply, has 2 voices, and was last updated by akhristiansen 6 years, 6 months ago.
- Topic
I have build a custom bundle called promotions on oro platform & it has an entity called Promotion. The data grid for promotion shows all the records from the table. I want to show only records that belong to the user organization.
But don’t allow to do any operations such as edit, delete etc on such records. ACL is not applied properly ?
What am doing wrong here ?
My Entity code is below :
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167<?php/*** Created by PhpStorm.* User: Sachin* Date: 21-09-2017* Time: 09:46 PM*/namespace Hko\Bundle\PromotionBundle\Entity;use Doctrine\ORM\Mapping as ORM;use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config;use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\ConfigField;use Gedmo\SoftDeleteable\SoftDeleteable;use \Gedmo\SoftDeleteable\Traits\SoftDeleteable as SoftDeleteableTraits;use Oro\Bundle\EntityBundle\EntityProperty\DatesAwareTrait;use Oro\Bundle\OrganizationBundle\Entity\OrganizationAwareInterface;use Oro\Bundle\OrganizationBundle\Entity\Ownership\OrganizationAwareTrait;use Hko\Bundle\PromotionBundle\Model\ExtendPromotion;use Oro\Bundle\OrganizationBundle\Entity\OrganizationInterface;/*** @ORM\Table("hko_promotions")* @ORM\Entity(repositoryClass="Hko\Bundle\PromotionBundle\Entity\Repository\PromotionRepository")* @Config(* routeName="hkoPromotion.promotion_index",* routeView="hkoPromotion.promotion_view",* routeCreate="hkoPromotion.promotion_create",* routeUpdate="hkoPromotion.promotion_update",* defaultValues={* "security"={* "type"="ACL",* "group_name"="",* "permissions"="All",* "category"="account_management"* },** "ownership"={* "owner_type"="ORGANIZATION",* "organization_field_name"="organization",* "organization_column_name"="organization_id",* }* }* )*/class Promotion extends ExtendPromotion implementsOrganizationAwareInterface,SoftDeleteable{use OrganizationAwareTrait;use SoftDeleteableTraits;use DatesAwareTrait;/*** @var integer** @ORM\Column(name="id", type="integer")* @ORM\Id* @ORM\GeneratedValue(strategy="AUTO")*/protected $id;/*** @var string* @ORM\Column(name="name", type="string",nullable=true)*/protected $name;/*** @var string* @ORM\Column(name="coupon_code", type="string",nullable=true)*/protected $couponCode;/*** @var Organization* @ORM\ManyToOne(targetEntity="Oro\Bundle\OrganizationBundle\Entity\Organization")* @ORM\JoinColumn(name="organization_id", referencedColumnName="id", onDelete="SET NULL")*/protected $organization;/*** Get id** @return integer*/public function getId(){return $this->id;}/*** Set name** @param string $name** @return Promotion*/public function setName($name){$this->name = $name;return $this;}/*** Get name** @return string*/public function getName(){return $this->name;}/*** Set couponCode** @param string $couponCode** @return Promotion*/public function setCouponCode($couponCode){$this->couponCode = $couponCode;return $this;}/*** Get couponCode** @return string*/public function getCouponCode(){return $this->couponCode;}/*** @param OrganizationInterface $organization** @return $this*/public function setOrganization(OrganizationInterface $organization){$this->organization = $organization;return $this;}/*** @return OrganizationInterface*/public function getOrganization(){return $this->organization;}}
The forum ‘OroPlatform’ is closed to new topics and replies.