11<h1 align =" center " >ACL Plugin for <a href =" http://flextype.org/ " >Flextype</a ></h1 >
22
33<p align =" center " >
4- <a href =" https://github.com/flextype-plugins/acl/releases " ><img alt =" Version " src =" https://img.shields.io/github/release/flextype-plugins/acl.svg?label=version&color=black " ></a > <a href =" https://github.com/flextype-plugins/acl " ><img src =" https://img.shields.io/badge/license-MIT-blue.svg?color=black " alt =" License " ></a > <a href =" https://github.com/flextype-plugins/acl " ><img src =" https://img.shields.io/github/downloads/flextype-plugins/acl/total.svg?color=black " alt =" Total downloads " ></a > <a href =" https://github.com/flextype/flextype " ><img src =" https://img.shields.io/badge/Flextype-0.9.9 -green.svg " alt =" Flextype " ></a > <a href =" " ><img src =" https://img.shields.io/discord/423097982498635778.svg?logo=discord&color=black&label=Discord%20Chat " alt =" Discord " ></a >
4+ <a href =" https://github.com/flextype-plugins/acl/releases " ><img alt =" Version " src =" https://img.shields.io/github/release/flextype-plugins/acl.svg?label=version&color=black " ></a > <a href =" https://github.com/flextype-plugins/acl " ><img src =" https://img.shields.io/badge/license-MIT-blue.svg?color=black " alt =" License " ></a > <a href =" https://github.com/flextype-plugins/acl " ><img src =" https://img.shields.io/github/downloads/flextype-plugins/acl/total.svg?color=black " alt =" Total downloads " ></a > <a href =" https://github.com/flextype/flextype " ><img src =" https://img.shields.io/badge/Flextype-0.9.10 -green.svg " alt =" Flextype " ></a > <a href =" " ><img src =" https://img.shields.io/discord/423097982498635778.svg?logo=discord&color=black&label=Discord%20Chat " alt =" Discord " ></a >
55</p >
66
77## Features
@@ -15,7 +15,7 @@ The following dependencies need to be downloaded and installed for ACL Plugin.
1515
1616| Item | Version | Download |
1717| ---| ---| ---|
18- | [ flextype] ( https://github.com/flextype/flextype ) | 0.9.9 | [ download] ( https://github.com/flextype/flextype/releases ) |
18+ | [ flextype] ( https://github.com/flextype/flextype ) | 0.9.10 | [ download] ( https://github.com/flextype/flextype/releases ) |
1919| [ site] ( https://github.com/flextype-plugins/site ) | >=1.0.0 | [ download] ( https://github.com/flextype-plugins/site/releases ) |
2020| [ twig] ( https://github.com/flextype-plugins/twig ) | >=1.0.0 | [ download] ( https://github.com/flextype-plugins/twig/releases ) |
2121
@@ -56,7 +56,7 @@ The following dependencies need to be downloaded and installed for ACL Plugin.
5656
5757#### Example
5858```
59- $app ->get('/my-route', 'MyController:method()')
59+ $flextype ->get('/my-route', 'MyController:method()')
6060 ->setName('my.route.name')
6161 ->add(new AclIsUserLoggedInMiddleware(['container' => $flextype,
6262 'redirect' => 'another.route.name']));
@@ -74,7 +74,7 @@ $app->get('/my-route', 'MyController:method()')
7474
7575#### Example
7676```
77- $app ->get('/my-route', 'MyController:method()')
77+ $flextype ->get('/my-route', 'MyController:method()')
7878 ->setName('my.route.name')
7979 ->add(new AclAccountsIsUserLoggedInRolesInMiddleware(['container' => $flextype,
8080 'roles' => 'admin, moderator'
@@ -93,7 +93,7 @@ $app->get('/my-route', 'MyController:method()')
9393
9494#### Example
9595```
96- $app ->get('/my-route', 'MyController:method()')
96+ $flextype ->get('/my-route', 'MyController:method()')
9797 ->setName('my.route.name')
9898 ->add(new AclIsUserLoggedInEmailsInMiddleware(['container' => $flextype,
9999@@ -112,7 +112,7 @@ $app->get('/my-route', 'MyController:method()')
112112
113113#### Example
114114```
115- $app ->get('/my-route', 'MyController:method()')
115+ $flextype ->get('/my-route', 'MyController:method()')
116116 ->setName('my.route.name')
117117 ->add(new AclIsUserLoggedInUuidInMiddleware(['container' => $flextype,
118118 'uuids' => 'ea7432a3-b2d5-4b04-b31d-1c5acc7a55e2, d549af27-79a0-44f2-b9b1-e82b47bf87e2'
@@ -129,7 +129,7 @@ $app->get('/my-route', 'MyController:method()')
129129
130130#### Example
131131```
132- $app ->get('/my-route', 'MyController:method()')
132+ $flextype ->get('/my-route', 'MyController:method()')
133133 ->setName('my.route.name')
134134 ->add(new AclIsUserNotLoggedInMiddleware(['container' => $flextype,
135135 'redirect' => 'another.route.name']));
@@ -147,7 +147,7 @@ $app->get('/my-route', 'MyController:method()')
147147
148148#### Example
149149```
150- $app ->get('/my-route', 'MyController:method()')
150+ $flextype ->get('/my-route', 'MyController:method()')
151151 ->setName('my.route.name')
152152 ->add(new AclAccountsIsUserLoggedInRolesNotInMiddleware(['container' => $flextype,
153153 'roles' => 'admin, moderator'
@@ -166,7 +166,7 @@ $app->get('/my-route', 'MyController:method()')
166166
167167#### Example
168168```
169- $app ->get('/my-route', 'MyController:method()')
169+ $flextype ->get('/my-route', 'MyController:method()')
170170 ->setName('my.route.name')
171171 ->add(new AclIsUserLoggedInEmailsNotInMiddleware(['container' => $flextype,
172172@@ -185,7 +185,7 @@ $app->get('/my-route', 'MyController:method()')
185185
186186#### Example
187187```
188- $app ->get('/my-route', 'MyController:method()')
188+ $flextype ->get('/my-route', 'MyController:method()')
189189 ->setName('my.route.name')
190190 ->add(new AclIsUserLoggedInUuidNotInMiddleware(['container' => $flextype,
191191 'uuids' => 'ea7432a3-b2d5-4b04-b31d-1c5acc7a55e2, d549af27-79a0-44f2-b9b1-e82b47bf87e2'
@@ -513,54 +513,54 @@ You may restrict access for specific users to your specific code in the PHP.
513513#### Run private code for logged in users
514514
515515``` php
516- if ($flextype->acl->isUserLoggedIn()) {
516+ if ($flextype->container(' acl') ->isUserLoggedIn()) {
517517 // Private code here..
518518}
519519```
520520
521521#### Run private content for users with roles: admin and student
522522
523523``` php
524- if ($flextype->acl->isUserLoggedInRolesIn('admin, student')) {
524+ if ($flextype->container(' acl') ->isUserLoggedInRolesIn('admin, student')) {
525525 // Private code here..
526526}
527527```
528528
529529#### Run private code for users with uuids ea7432a3-b2d5-4b04-b31d-1c5acc7a55e2 and d549af27-79a0-44f2-b9b1-e82b47bf87e2
530530
531531``` php
532- if ($flextype->acl->isUserLoggedInUuidIn('ea7432a3-b2d5-4b04-b31d-1c5acc7a55e2, d549af27-79a0-44f2-b9b1-e82b47bf87e2') {
532+ if ($flextype->container(' acl') ->isUserLoggedInUuidIn('ea7432a3-b2d5-4b04-b31d-1c5acc7a55e2, d549af27-79a0-44f2-b9b1-e82b47bf87e2') {
533533 // Private content here..
534534}
535535```
536536
537537#### Run private code for users with emails [email protected] , [email protected] 538538
539539``` php
540- if ($flextype->acl->isUserLoggedInEmailIn('
[email protected] ,
[email protected] ')) {
540+ if ($flextype->
container(' acl
') ->isUserLoggedInEmailIn('
[email protected] ,
[email protected] ')) {
541541 // Private content here..
542542}
543543```
544544
545545#### Show logged in email
546546
547547``` php
548- echo 'Hello ' . $flextype->acl->getUserLoggedInEmail();
548+ echo 'Hello ' . $flextype->container(' acl') ->getUserLoggedInEmail();
549549```
550550
551551#### Show logged in uuid
552552
553553``` php
554- echo 'Hello ' . $flextype->acl->getUserLoggedInEmail();
555- echo 'your uuid: ' . $flextype->acl->getUserLoggedInUuid();
554+ echo 'Hello ' . $flextype->container(' acl') ->getUserLoggedInEmail();
555+ echo 'your uuid: ' . $flextype->container(' acl') ->getUserLoggedInUuid();
556556```
557557
558558#### Show logged in roles
559559
560560``` php
561- echo 'Hello ' . $flextype->acl->getUserLoggedInEmail();
562- echo 'your uuid: ' . $flextype->acl->getUserLoggedInUuid();
563- echo 'and your roles: ' . $flextype->acl->getUserLoggedInRoles();
561+ echo 'Hello ' . $flextype->container(' acl') ->getUserLoggedInEmail();
562+ echo 'your uuid: ' . $flextype->container(' acl') ->getUserLoggedInUuid();
563+ echo 'and your roles: ' . $flextype->container(' acl') ->getUserLoggedInRoles();
564564```
565565
566566## LICENSE
0 commit comments