From ddd8c4f7a56ccf3e3122d6232a8ec2cc80c261b3 Mon Sep 17 00:00:00 2001 From: Etienne Roudeix Date: Tue, 22 Oct 2013 15:57:31 +0200 Subject: [PATCH] fix auth loop --- core/lib/Thelia/Core/Template/Loop/Auth.php | 4 +-- templates/admin/default/admin-layout.tpl | 18 +++++----- .../default/ajax/product-related-tab.html | 6 ++-- .../default/ajax/template-attribute-list.html | 2 +- .../default/ajax/template-feature-list.html | 2 +- templates/admin/default/attribute-edit.html | 4 +-- templates/admin/default/attributes.html | 10 +++--- templates/admin/default/categories.html | 16 ++++----- templates/admin/default/category-edit.html | 2 +- templates/admin/default/configuration.html | 34 +++++++++---------- templates/admin/default/countries.html | 6 ++-- templates/admin/default/currencies.html | 8 ++--- templates/admin/default/customers.html | 8 ++--- templates/admin/default/feature-edit.html | 4 +-- templates/admin/default/features.html | 10 +++--- templates/admin/default/folder-edit.html | 2 +- templates/admin/default/folders.html | 16 ++++----- .../includes/content-folder-management.html | 2 +- .../admin/default/includes/module-block.html | 6 ++-- .../default/includes/product-details-tab.html | 2 +- templates/admin/default/languages.html | 2 +- templates/admin/default/messages.html | 8 ++--- templates/admin/default/modules.html | 2 +- templates/admin/default/orders.html | 2 +- templates/admin/default/profiles.html | 6 ++-- .../admin/default/shipping-configuration.html | 6 ++-- templates/admin/default/shipping-zones.html | 2 +- templates/admin/default/taxes-rules.html | 12 +++---- templates/admin/default/templates.html | 8 ++--- templates/admin/default/variables.html | 8 ++--- 30 files changed, 109 insertions(+), 109 deletions(-) diff --git a/core/lib/Thelia/Core/Template/Loop/Auth.php b/core/lib/Thelia/Core/Template/Loop/Auth.php index f5691cbd6..a30eeacf0 100755 --- a/core/lib/Thelia/Core/Template/Loop/Auth.php +++ b/core/lib/Thelia/Core/Template/Loop/Auth.php @@ -45,7 +45,7 @@ class Auth extends BaseLoop { return new ArgumentCollection( new Argument( - 'roles', + 'role', new TypeCollection( new AlphaNumStringListType() ), @@ -75,7 +75,7 @@ class Auth extends BaseLoop */ public function exec(&$pagination) { - $roles = $this->getRoles(); + $roles = $this->getRole(); $resource = $this->getResource(); $access = $this->getAccess(); diff --git a/templates/admin/default/admin-layout.tpl b/templates/admin/default/admin-layout.tpl index 743264d7a..3d671ecb2 100644 --- a/templates/admin/default/admin-layout.tpl +++ b/templates/admin/default/admin-layout.tpl @@ -44,7 +44,7 @@ {* display top bar only if admin is connected *} - {loop name="top-bar-auth" type="auth" roles="ADMIN"} + {loop name="top-bar-auth" type="auth" role="ADMIN"} {* -- Brand bar section ------------------------------------------------- *} @@ -107,13 +107,13 @@ {intl l="Home"} - {loop name="menu-auth-customer" type="auth" roles="ADMIN" permissions="admin.customers.view"} + {loop name="menu-auth-customer" type="auth" role="ADMIN" resource="admin.customer" access="VIEW"}
  • {intl l="Customers"}
  • {/loop} - {loop name="menu-auth-order" type="auth" roles="ADMIN" permissions="admin.orders.view"} + {loop name="menu-auth-order" type="auth" role="ADMIN" resource="admin.order" access="VIEW"} {/loop} - {loop name="menu-auth-catalog" type="auth" roles="ADMIN" permissions="admin.catalog.view"} + {loop name="menu-auth-catalog" type="auth" role="ADMIN" resource="admin.category" access="VIEW"}
  • {intl l="Catalog"}
  • {/loop} - {loop name="menu-auth-content" type="auth" roles="ADMIN" permissions="admin.folders.view"} + {loop name="menu-auth-content" type="auth" role="ADMIN" resource="admin.folder" access="VIEW"}
  • {intl l="Folders"}
  • {/loop} - {loop name="menu-auth-coupon" type="auth" roles="ADMIN" permissions="admin.coupon.view"} + {loop name="menu-auth-coupon" type="auth" role="ADMIN" resource="admin.coupon" access="VIEW"}
  • {intl l="Coupons"}
  • {/loop} - {loop name="menu-auth-config" type="auth" roles="ADMIN" permissions="admin.config.view"} + {loop name="menu-auth-config" type="auth" role="ADMIN" resource="admin.config" access="VIEW"}
  • {intl l="Configuration"}
  • {/loop} - {loop name="menu-auth-modules" type="auth" roles="ADMIN" permissions="admin.modules.view"} + {loop name="menu-auth-modules" type="auth" role="ADMIN" resource="admin.module" access="VIEW"}
  • {intl l="Modules"}
  • @@ -174,7 +174,7 @@ {/loop} - {loop name="top-bar-search" type="auth" roles="ADMIN" permissions="admin.search"} + {loop name="top-bar-search" type="auth" role="ADMIN" resource="admin.search" access="VIEW"}