Skip to content

Commit 3200799

Browse files
authored
BB-21690: Global Brands Data (#33784)
1 parent 12a18f9 commit 3200799

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed
+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
.. _backend-security-bundle-global-view-entities:
2+
3+
Global View Entities
4+
====================
5+
6+
In Enterprise editions, data from the ACL-protected entities with the User, Business Unit, and Organization ownership types are separated by organizations.
7+
8+
You can view an entity only from the organization where it was created. You can view data from all organizations only in the Global organization when the access level to the View permission is set to Global.
9+
10+
A global view entity is helpful for cases when data created in one organization should be available from other non-global organizations. For example, when the administrator wants to create a predefined list of brands for products from other organizations.
11+
12+
If the entity is marked as a Global view, data created in the global organization will be available in non-global organizations along with
13+
the data created in this organization.
14+
15+
You can only view a global view entity from a non-global organization. It cannot be edited, deleted, or shared.
16+
17+
Configuring an Entity as a Global View
18+
--------------------------------------
19+
20+
To see the data created from the global organization in a non-global organization for an ACL-protected entity,configure the chosen entity with the ``global_view`` parameter of the ``security`` scope in the
21+
``defaultValues`` section of the ``@Config`` annotation, as illustrated below:
22+
23+
.. code-block:: php
24+
25+
/**
26+
* @Config(
27+
* defaultValues={
28+
* "security"={
29+
...
30+
* "global_view"=true,
31+
* }
32+
* }
33+
* )
34+
*/
35+
class MyEntity
36+
37+
If the entity already exists, create a migration to add the ``global_view`` parameter to the entity config:
38+
39+
.. code-block:: php
40+
41+
namespace Acme\Bundle\MyBundle\Migrations\Schema\v1_0;
42+
43+
use Doctrine\DBAL\Schema\Schema;
44+
use Oro\Bundle\EntityExtendBundle\Migration\OroOptions;
45+
use Oro\Bundle\MigrationBundle\Migration\Migration;
46+
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
47+
48+
/**
49+
* Switch my entity to the global view.
50+
*/
51+
class MakeMyEntityGlobalView implements Migration
52+
{
53+
/**
54+
* {@inheritDoc}
55+
*/
56+
public function up(Schema $schema, QueryBag $queries)
57+
{
58+
$table = $schema->getTable('name_of_my_table');
59+
60+
$options = new OroOptions();
61+
$options->set('ownership', 'global_view', true);
62+
$table->addOption(OroOptions::KEY, $options);
63+
}
64+
}
65+
66+
.. include:: /include/include-links-dev.rst
67+
:start-after: begin

backend/security/index.rst

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Read more in the following topics below:
3434
* :ref:`How to Configure and Apply Custom Permissions to an Entity <backend-security-bundle-permissions>`
3535
* :ref:`How to Work with Configurable Permissions <backend-security-bundle-configurable-permissions>`
3636

37+
* :ref:`Global View Entities <backend-security-bundle-global-view-entities>`
38+
3739
.. toctree::
3840
:titlesonly:
3941
:hidden:
@@ -47,3 +49,4 @@ Read more in the following topics below:
4749
access-rules
4850
custom-listeners
4951
example
52+
global-view-entities

bundles/platform/SecurityBundle/index.rst

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ Related Documentation
3131
* :ref:`How to Configure and Apply Custom Permissions to an Entity <backend-security-bundle-permissions>`
3232
* :ref:`How to Work with Configurable Permissions <backend-security-bundle-configurable-permissions>`
3333

34+
* :ref:`Global View Entities <backend-security-bundle-global-view-entities>`
35+
3436
.. tip::
3537
Take a look an how ACL works in the application in the :ref:`Access Levels and Ownership <backend-security-bundle-example>` topic which illustrates the hierarchy of two sample organizations and access setup within them.
3638

0 commit comments

Comments
 (0)