Skip to content

Commit

Permalink
Moving 3x fixes to 4x branch (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
kedarkhaire authored Jan 17, 2025
1 parent 1e480cf commit 424d17e
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function apigee_edge_apiproduct_rbac_api_product_access(EntityInterface $entity,

if (empty($entity->getAttributeValue($rbac_attribute_name))) {
if ('assign' === $operation) {
$result = AccessResult::neutral("{$operation} is not allowed on {$entity->label()} API product.");
$result = AccessResult::forbidden("{$operation} is not allowed on {$entity->label()} API product.");
}
elseif ($config->get('grant_access_if_attribute_missing')) {
$result = AccessResult::allowed();
Expand All @@ -94,7 +94,7 @@ function apigee_edge_apiproduct_rbac_api_product_access(EntityInterface $entity,
// Displaying these products should be solved on the form level always.
if (empty(array_intersect($roles, $account->getRoles()))) {
if ('assign' === $operation) {
$result = AccessResult::neutral("{$operation} is not allowed on {$entity->label()} API product.");
$result = AccessResult::forbidden("{$operation} is not allowed on {$entity->label()} API product.");
}
else {
$result = _apigee_edge_user_has_an_app_with_product($entity->id(), $account, TRUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class TeamMembersList extends ControllerBase {
* @param \Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface $org_controller
* The organization controller service.
*/
public function __construct(TeamMembershipManagerInterface $team_membership_manager, EntityTypeManagerInterface $entity_type_manager, ?ModuleHandlerInterface $module_handler = NULL, CompanyMembershipObjectCacheInterface $company_membership_object_cache, AppGroupMembershipObjectCacheInterface $appgroup_membership_object_cache, OrganizationControllerInterface $org_controller) {
public function __construct(TeamMembershipManagerInterface $team_membership_manager, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, CompanyMembershipObjectCacheInterface $company_membership_object_cache, AppGroupMembershipObjectCacheInterface $appgroup_membership_object_cache, OrganizationControllerInterface $org_controller) {
if (!$module_handler) {
@trigger_error('Calling ' . __METHOD__ . ' without the $module_handler is deprecated in apigee_edge:8-x-1.19 and is required before apigee_edge:8.x-2.0. See https://github.com/apigee/apigee-edge-drupal/pull/518.', E_USER_DEPRECATED);
$module_handler = \Drupal::moduleHandler();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class TeamAppListByTeam extends AppListBuilder implements ContainerInjectionInte
* @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker
* The app warnings checker service.
*/
public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, RouteMatchInterface $route_match, ?ConfigFactoryInterface $config_factory = NULL, AppWarningsCheckerInterface $app_warnings_checker) {
public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, RouteMatchInterface $route_match, ConfigFactoryInterface $config_factory, AppWarningsCheckerInterface $app_warnings_checker) {
if (!$config_factory) {
$config_factory = \Drupal::service('config.factory');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class TeamMemberRoleStorage extends SqlContentEntityStorage implements TeamMembe
* @param \Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface $org_controller
* The organization controller service.
*/
public function __construct(EntityTypeInterface $entity_type, Connection $database, EntityFieldManagerInterface $entity_field_manager, CacheBackendInterface $cache, LanguageManagerInterface $language_manager, MemoryCacheInterface $memory_cache, TeamMembershipManagerInterface $team_membership_manager, LoggerInterface $logger, ?EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, ?EntityTypeManagerInterface $entity_type_manager = NULL, OrganizationControllerInterface $org_controller) {
public function __construct(EntityTypeInterface $entity_type, Connection $database, EntityFieldManagerInterface $entity_field_manager, CacheBackendInterface $cache, LanguageManagerInterface $language_manager, MemoryCacheInterface $memory_cache, TeamMembershipManagerInterface $team_membership_manager, LoggerInterface $logger, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityTypeManagerInterface $entity_type_manager, OrganizationControllerInterface $org_controller) {
parent::__construct($entity_type, $database, $entity_field_manager, $cache, $language_manager, $memory_cache, $entity_type_bundle_info, $entity_type_manager);
$this->teamMembershipManager = $team_membership_manager;
$this->logger = $logger;
Expand Down
6 changes: 4 additions & 2 deletions modules/apigee_edge_teams/tests/src/Functional/UiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,10 @@ protected function teamsWorkflowTest() {
// Login with the default user, the created team app should be visible on
// the team app administer collection page (/team-apps).
$this->drupalLogin($this->account);
$this->drupalGet(Url::fromRoute('entity.team_app.collection'));
$this->drupalGet($this->team->toUrl('collection'));
$this->assertSession()->linkExists($team_modified_display_name);
$this->clickLink($team_modified_display_name);
$this->clickLink('Team Apps');
$this->assertSession()->linkExists($team_app_1_modified_display_name);

// Try to delete the first team app without verification code then with a
Expand All @@ -270,7 +272,7 @@ protected function teamsWorkflowTest() {

// Remove the other user from the team's member list.
$this->drupalLogin($this->account);
$this->drupalGet(Url::fromRoute('entity.team_app.collection'));
$this->drupalGet($this->team->toUrl('collection'));
$this->clickLink($team_modified_display_name);
$this->clickLink('Members');
$this->getSession()->getPage()->findById((Html::getUniqueId($this->otherAccount->getEmail())))->clickLink('Remove');
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/ListBuilder/AppListBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class AppListBuilder extends EdgeEntityListBuilder {
* @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker
* The app warnings checker service.
*/
public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, RequestStack $request_stack, TimeInterface $time, ?ConfigFactoryInterface $config_factory = NULL, AppWarningsCheckerInterface $app_warnings_checker) {
public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, RequestStack $request_stack, TimeInterface $time, ConfigFactoryInterface $config_factory, AppWarningsCheckerInterface $app_warnings_checker) {
if (!$config_factory) {
$config_factory = \Drupal::service('config.factory');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class DeveloperAppListBuilderForDeveloper extends AppListBuilder implements Cont
* @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker
* The app warnings checker service.
*/
public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, AccountInterface $current_user, RouteMatchInterface $route_match, ?ConfigFactoryInterface $config_factory = NULL, AppWarningsCheckerInterface $app_warnings_checker) {
public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, AccountInterface $current_user, RouteMatchInterface $route_match, ConfigFactoryInterface $config_factory, AppWarningsCheckerInterface $app_warnings_checker) {
if (!$config_factory) {
$config_factory = \Drupal::service('config.factory');
}
Expand Down
1 change: 1 addition & 0 deletions src/Plugin/ApigeeFieldStorageFormat/CSV.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
*
* @see https://github.com/symfony/symfony/issues/27447
*/
// @phpcs:ignore Drupal.NamingConventions.ValidClassName.NoUpperAcronyms
class CSV implements FieldStorageFormatInterface {

/**
Expand Down
1 change: 1 addition & 0 deletions src/Plugin/ApigeeFieldStorageFormat/JSON.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* weight = 1000,
* )
*/
// @phpcs:ignore Drupal.NamingConventions.ValidClassName.NoUpperAcronyms
class JSON implements FieldStorageFormatInterface {

/**
Expand Down

0 comments on commit 424d17e

Please sign in to comment.