Skip to content

Commit

Permalink
BAP-18994: Backoffice User with Specific Role does not have access to…
Browse files Browse the repository at this point in the history
… the entity if his used Search (#24380)

- fix entities with routes to update pages in search results
- add "acl_permission" option to search.yml to have possibility search entities depends on permissions
  • Loading branch information
DmitriyDemeshko authored and vsoroka committed Jul 16, 2019
1 parent 61feecd commit ec5ecb8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
Expand Up @@ -75,7 +75,7 @@ search:
label: oro.customer.customeruserrole.entity_plural_label
title_fields: [label]
route:
name: oro_customer_customer_user_role_update
name: oro_customer_customer_user_role_view
parameters:
id: id
search_template: OroCustomerBundle:CustomerUserRole:searchResult.html.twig
Expand Down
@@ -0,0 +1,34 @@
@fixture-OroUserBundle:user.yml

Feature: Customer User Role search
In order to search Customer User Role
As an user
I should see view page of Customer User Role entity in search results with role permissions 'View:Global'
for Customer User Role entity

Scenario: Edit view permissions for Customer User Role entity with Sales Rep Role
Given I login as administrator
Then go to System / User Management / Roles
When I filter Label as is equal to "Sales Rep"
And I click edit "Sales Rep" in grid
And select following permissions:
| Customer User Role | View:Global |
And save and close form
Then I should see "Role saved" flash message

Scenario: Search Customer User Role
Given I login as "charlie" user
And I click "Search"
And type "admin" in "search"
When I click "Search Submit"
Then I should be on Search Result page
And I should see following search entity types:
| Type | N | isSelected |
| Customer User Roles | 1 | |
And I should see following search results:
| Title | Type |
| Administrator | Customer User Role |

Scenario: View entity from search results
Given I follow "Administrator"
Then I should be on Customer User Role View page
1 change: 1 addition & 0 deletions src/Oro/Bundle/CustomerBundle/Tests/Behat/behat.yml
Expand Up @@ -22,6 +22,7 @@ oro_behat_extension:
- OroAddressBundle::AddressContext
- OroCustomerBundle::CustomerVisitorContext
- OroEmailBundle::EmailContext
- OroSearchBundle::SearchContext
paths:
- '@OroCustomerBundle/Tests/Behat/Features'

Expand Down

0 comments on commit ec5ecb8

Please sign in to comment.