Skip to content

Commit

Permalink
add cron overview #1407
Browse files Browse the repository at this point in the history
  • Loading branch information
s3tezsky authored Feb 28, 2020
2 parents efd91f6 + 72480c9 commit fdac77a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/packages/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ security:
# same pattern must be in routing_front.yml
- { path: ^/login-as-remembered-user/$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/superadmin/, roles: ROLE_SUPER_ADMIN }
- { path: ^/admin/cron/*, roles: ROLE_SUPER_ADMIN }
- { path: ^/admin/translation/list/$, roles: ROLE_SUPER_ADMIN }
- { path: ^/admin/$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/authorization/$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
Expand Down
2 changes: 1 addition & 1 deletion config/services/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ services:
# Example:
# Shopsys\FrameworkBundle\Model\Product\Elasticsearch\ProductExportCronModule:
# tags:
# - { name: shopsys.cron, hours: '*', minutes: '*' }
# - { name: shopsys.cron, hours: '*', minutes: '*', readableName: 'Product search export' }
21 changes: 21 additions & 0 deletions tests/App/Smoke/Http/RouteConfigCustomization.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,27 @@ private function configureAdminRoutes(RouteConfigCustomizer $routeConfigCustomiz
$config->changeDefaultRequestDataSet($debugNote)
->setExpectedStatusCode(302);
})
->customizeByRouteName('admin_default_schedulecron', function (RouteConfig $config) {
$config->changeDefaultRequestDataSet('Standard admin is not allowed to schedule cron')
->setExpectedStatusCode(302);
$config->addExtraRequestDataSet('Superadmin can schedule cron')
->setAuth(new BasicHttpAuth('superadmin', 'admin123'))
->setExpectedStatusCode(302);
})
->customizeByRouteName('admin_default_cronenable', function (RouteConfig $config) {
$config->changeDefaultRequestDataSet('Standard admin is not allowed to enable cron')
->setExpectedStatusCode(302);
$config->addExtraRequestDataSet('Superadmin can enable cron')
->setAuth(new BasicHttpAuth('superadmin', 'admin123'))
->setExpectedStatusCode(302);
})
->customizeByRouteName('admin_default_crondisable', function (RouteConfig $config) {
$config->changeDefaultRequestDataSet('Standard admin is not allowed to disable cron')
->setExpectedStatusCode(302);
$config->addExtraRequestDataSet('Superadmin can disable cron')
->setAuth(new BasicHttpAuth('superadmin', 'admin123'))
->setExpectedStatusCode(302);
})
->customizeByRouteName('admin_administrator_edit', function (RouteConfig $config) {
$config->changeDefaultRequestDataSet('Standard admin is not allowed to edit superadmin (with ID 1)')
->setExpectedStatusCode(302);
Expand Down

0 comments on commit fdac77a

Please sign in to comment.