/** * {@inheritdoc} */ public function isGranted($permissionCode) { if (null === $this->settings) { $this->settings = $this->settingsManager->load('sylius_security'); } if (false === $this->settings->get('enabled')) { return true; } return $this->authorizationChecker->isGranted($permissionCode); }
function it_cannot_be_supported_when_the_default_tax_calculation_strategy_setting_does_not_match_the_strategy_type(SettingsInterface $settings, OrderInterface $order, ZoneInterface $zone) { $settings->get('default_tax_calculation_strategy')->willReturn('order_item_units_based'); $this->supports($order, $zone)->shouldReturn(false); }
/** * {@inheritdoc} */ public function supports(OrderInterface $order, ZoneInterface $zone) { return $this->settings->get('default_tax_calculation_strategy') === $this->type; }
/** * {@inheritdoc} */ public function getZone() { return $this->settings->get('default_tax_zone'); }