File tree Expand file tree Collapse file tree 11 files changed +92
-31
lines changed
Expand file tree Collapse file tree 11 files changed +92
-31
lines changed Original file line number Diff line number Diff line change 11{
2- "name" : " bitbag /acl-plugin" ,
2+ "name" : " acseo /acl-plugin" ,
33 "type" : " sylius-plugin" ,
44 "description" : " ACL plugin for Sylius." ,
55 "license" : " MIT" ,
66 "require" : {
77 "php" : " ^8.0" ,
8- "sylius/sylius" : " ^1.12" ,
9- "symfony/webpack-encore-bundle" : " ^1.15"
8+ "sylius/sylius" : " ^2.0"
109 },
1110 "require-dev" : {
1211 "behat/behat" : " ^3.7" ,
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public function isOptional(): bool
2727 return false ;
2828 }
2929
30- public function warmUp (string $ cacheDir ): array
30+ public function warmUp (string $ cacheDir, ? string $ buildDir = null ): array
3131 {
3232 $ this ->filesystemCache ->deleteItems (PrivilegeInterface::CACHE_CLEARER_KEYS );
3333
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public function __construct(
2727 /**
2828 * @throws InvalidArgumentException
2929 */
30- public function transform ($ value )
30+ public function transform (mixed $ value ): mixed
3131 {
3232 Assert::nullOrIsArray ($ value );
3333 $ tree = $ this ->compositePrivilege ->getSupportedRouteMap ([], true );
@@ -47,7 +47,7 @@ public function transform($value)
4747 /**
4848 * @throws InvalidArgumentException
4949 */
50- public function reverseTransform ($ value )
50+ public function reverseTransform (mixed $ value ): mixed
5151 {
5252 Assert::isArray ($ value , Collection::class);
5353
File renamed without changes.
Original file line number Diff line number Diff line change 33 - { resource: "@BitBagSyliusAclPlugin/Resources/config/resources.yml" }
44 - { resource: "@BitBagSyliusAclPlugin/Resources/config/grids.yml" }
55 - { resource: "@BitBagSyliusAclPlugin/Resources/config/permissions.yml" }
6+ - { resource: "@BitBagSyliusAclPlugin/Resources/config/twig_hooks.yml" }
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ bitbag_sylius_acl_admin_role:
22 resource : |
33 alias: bitbag_sylius_acl_plugin.role
44 section: admin
5- templates: "@SyliusAdmin\\Crud "
5+ templates: "@SyliusAdmin\\shared\\crud "
66 redirect: update
77 grid: bitbag_sylius_acl_plugin_admin_role
88 except: ['show']
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ services:
2222 - " @request_stack"
2323
2424 bitbag_sylius_acl_plugin.request_matcher.admin :
25- class : Symfony\Component\HttpFoundation\RequestMatcher
25+ class : Symfony\Component\HttpFoundation\RequestMatcher\ExpressionRequestMatcher
2626 arguments :
27- - " %sylius.security.admin_regex% "
28-
27+ $language : ' @validator.expression_language '
28+ $expression : " path matches '#%sylius.security.admin_regex%#' "
Original file line number Diff line number Diff line change 11services :
2- bitbag_sylius_acl_plugin.templating.helper.acl :
3- class : BitBag\SyliusAclPlugin\Templating\Helper\AclHelper
4- arguments :
5- - " @bitbag_sylius_acl_plugin.resolver.admin_permission"
6- tags :
7- - { name: templating.helper, alias: bitbag_acl }
8-
92 bitbag_sylius_acl_plugin.twig.extension.acl :
103 class : BitBag\SyliusAclPlugin\Twig\AclExtension
114 arguments :
12- - " @bitbag_sylius_acl_plugin.templating.helper.acl "
5+ - " @bitbag_sylius_acl_plugin.resolver.admin_permission "
136 tags :
147 - { name: twig.extension }
Original file line number Diff line number Diff line change 1+ sylius_twig_hooks :
2+ hooks :
3+ ' sylius_admin.admin_user.update.content.form.sections#left ' :
4+ account :
5+ template : ' @SyliusAdmin/admin_user/form/sections/account.html.twig'
6+ priority : 0
7+ roles :
8+ template : ' @BitBagSyliusAclPlugin/Admin/roles.html.twig'
9+ priority : -100
10+ # enabled: false
Original file line number Diff line number Diff line change 1+ {% set form = hookable_metadata .context .form %}
2+ <div class =" card-header" >
3+ <div class =" card-title" >
4+ {{ ' sylius.ui.roles' | trans }}
5+ </div >
6+ </div >
7+ <div class =" card-body" >
8+ <div class =" mb-3 field" >
9+ {{ form_row(form .rolesResources ) }}
10+ </div >
11+ <div class =" mb-3 field" >
12+ {{ form_row(form .enablePermissionChecker ) }}
13+ </div >
14+ </div >
15+ </div >
You can’t perform that action at this time.
0 commit comments