Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.
Forum Replies Created
-
AuthorReplies
-
Hello @brunpatoch, this issue has been resolved already
Hi @james_allies. Please try to set 'required' => false for phoneNumber, direction attributes at CallType.php and remove direction, phoneNumber nodes at CallBundle/Resources/config/validation.yml
In this case you should protect entities manually, as mentioned at page https://github.com/laboro/platform/blob/master/src/Oro/Bundle/SecurityBundle/Resources/doc/access-levels.md#manual-protection-of-select-queries.
For example, with QueryBuilder:
123456789$repository = $this->getDoctrine()->getRepository('AcmeDemoBundle:EntityB');$queryBuilder = $repository->createQueryBuilder('e')$queryBuilder->select('e')->join('e.entityA');$query = $this->get('ro_security.acl_helper')->apply($queryBuilder, 'VIEW');Or with objects:
12345678$entityB = $entityA->getEntityBs()->first();if (!$this->securityFacade->isGranted('VIEW', $entityB)) {throw new AccessDeniedException('Access denided');} else {// access is granted}@dimonixx, there are several ways to load entities. Could you please show an example how do you load entities?
Hi @dimonixx, @andesk. Let me clarify oro security protection. Data grids and param converters are automatically protected with security protection. Please check
https://github.com/laboro/platform/blob/master/src/Oro/Bundle/SecurityBundle/Resources/doc/access-levels.md#data-grids-protections
https://github.com/laboro/platform/blob/master/src/Oro/Bundle/SecurityBundle/Resources/doc/access-levels.md#protection-with-param-converters.But if you load objects manually, you should protect them with oro_security.acl_helper or oro_security.security_facade. Please check
https://github.com/laboro/platform/blob/master/src/Oro/Bundle/SecurityBundle/Resources/doc/access-levels.md#manual-protection-of-select-queries
https://github.com/laboro/platform/blob/master/src/Oro/Bundle/SecurityBundle/Resources/doc/access-levels.md#manual-access-check-on-objectTo be able use protection you should make several steps:
1 Add ownership annotation to entity, as you made:1234567891011121314151617181920212223242526.../**** @ORM\Entity* @ORM\Table(name="tbl_name_1")* @Config(* defaultValues={* "security"={* "type"="ACL",* "group_name"=""* },* "ownership"={* "owner_type"="ORGANIZATION",* "owner_field_name"="owner",* "owner_column_name"="organization_id"* }* }* )*/class EntityB{...}2 Make migration to create new acl_classes entry
1234567891011121314151617...class AcmeBundle implements Migration{public function up(Schema $schema, QueryBag $queries){$queries->addQuery(new UpdateEntityConfigEntityValueQuery('Oro\Bundle\AcmeBundle\Entity\EntityB','security','permissions','VIEW;CREATE;EDIT'));}}3 Add annotation to controller if you want to use param converters protection
123456789101112131415161718.../**** @Route("/acme/{id}/view", name="acme_entity_view", requirements={"id"="\d+"})* @Acl(* id="acme_entity_view",* type="entity",* class="OroAcmeBundle:Entity",* permission="VIEW"* )*/public function viewAction(Entity $entity){...}...4 run app/console oro:platform:update console command
Hi nurikabe, currently you can install synolia/syno-orocrm-fullcontact with commands:
123cd /path/to/projectwget http://getcomposer.org/composer.pharphp composer.phar require synolia/syno-orocrm-fullcontactHi! To create OneToOne relationship using migration, you can use Doctrine native methods Doctrine\DBAL\Schema\Table::addColumn() and Doctrine\DBAL\Schema\Table::addForeignKeyConstraint()
-
AuthorReplies