diff --git a/CHANGELOG.md b/CHANGELOG.md index 78319da..d755308 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ + +# [1.0.5](https://github.com/flextype-plugins/form-admin/compare/v1.0.4...v1.0.5) (2020-06-21) + +### Features + +* **core** updates for new ACL and Accounts Admin Plugins. + # [1.0.4](https://github.com/flextype-plugins/themes-admin/compare/v1.0.3...v1.0.4) (2020-05-07) diff --git a/plugin.yaml b/plugin.yaml index 7c850e1..40f3292 100755 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,5 +1,5 @@ name: Themes Admin -version: 1.0.4 +version: 1.0.5 description: Themes Admin plugin to manage site themes for the website frontend. icon: fas fa-paint-brush author: diff --git a/routes/web.php b/routes/web.php index b698921..61f8c02 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,7 +4,7 @@ namespace Flextype; -$app->group('/' . $admin_route, function () use ($app) : void { +$app->group('/' . $admin_route, function () use ($app, $flextype) : void { // ThemesController $app->get('/themes', 'ThemesController:index')->setName('admin.themes.index'); @@ -24,4 +24,8 @@ $app->post('/templates/duplicate', 'TemplatesController:duplicateProcess')->setName('admin.templates.duplicateProcess'); $app->post('/templates/delete', 'TemplatesController:deleteProcess')->setName('admin.templates.deleteProcess'); -})->add(new AdminPanelAuthMiddleware($flextype)); +})->add(new AclAccountIsUserLoggedInMiddleware(['container' => $flextype, 'redirect' => 'admin.accounts.login'])) + ->add(new AclAccountsIsUserLoggedInRolesOneOfMiddleware(['container' => $flextype, + 'redirect' => ($flextype->acl->isUserLoggedIn() ? 'admin.accounts.no-access' : 'admin.accounts.login'), + 'roles' => 'admin'])) + ->add('csrf');