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.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 >
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.11 -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.10 | [ download] ( https://github.com/flextype/flextype/releases ) |
18+ | [ flextype] ( https://github.com/flextype/flextype ) | 0.9.11 | [ 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,9 +56,9 @@ The following dependencies need to be downloaded and installed for ACL Plugin.
5656
5757#### Example
5858```
59- $ flextype->get('/my-route', 'MyController:method()')
59+ flextype() ->get('/my-route', 'MyController:method()')
6060 ->setName('my.route.name')
61- ->add(new AclIsUserLoggedInMiddleware(['container' => $flextype,
61+ ->add(new AclIsUserLoggedInMiddleware([
6262 'redirect' => 'another.route.name']));
6363```
6464
@@ -74,9 +74,9 @@ $flextype->get('/my-route', 'MyController:method()')
7474
7575#### Example
7676```
77- $ flextype->get('/my-route', 'MyController:method()')
77+ flextype() ->get('/my-route', 'MyController:method()')
7878 ->setName('my.route.name')
79- ->add(new AclAccountsIsUserLoggedInRolesInMiddleware(['container' => $flextype,
79+ ->add(new AclAccountsIsUserLoggedInRolesInMiddleware([
8080 'roles' => 'admin, moderator'
8181 'redirect' => 'another.route.name']));
8282```
@@ -93,9 +93,9 @@ $flextype->get('/my-route', 'MyController:method()')
9393
9494#### Example
9595```
96- $ flextype->get('/my-route', 'MyController:method()')
96+ flextype() ->get('/my-route', 'MyController:method()')
9797 ->setName('my.route.name')
98- ->add(new AclIsUserLoggedInEmailsInMiddleware(['container' => $flextype,
98+ ->add(new AclIsUserLoggedInEmailsInMiddleware([
9999100100 'redirect' => 'another.route.name']));
101101```
@@ -112,9 +112,9 @@ $flextype->get('/my-route', 'MyController:method()')
112112
113113#### Example
114114```
115- $ flextype->get('/my-route', 'MyController:method()')
115+ flextype() ->get('/my-route', 'MyController:method()')
116116 ->setName('my.route.name')
117- ->add(new AclIsUserLoggedInUuidInMiddleware(['container' => $flextype,
117+ ->add(new AclIsUserLoggedInUuidInMiddleware([
118118 'uuids' => 'ea7432a3-b2d5-4b04-b31d-1c5acc7a55e2, d549af27-79a0-44f2-b9b1-e82b47bf87e2'
119119 'redirect' => 'another.route.name']));
120120```
@@ -129,9 +129,9 @@ $flextype->get('/my-route', 'MyController:method()')
129129
130130#### Example
131131```
132- $ flextype->get('/my-route', 'MyController:method()')
132+ flextype() ->get('/my-route', 'MyController:method()')
133133 ->setName('my.route.name')
134- ->add(new AclIsUserNotLoggedInMiddleware(['container' => $flextype,
134+ ->add(new AclIsUserNotLoggedInMiddleware([
135135 'redirect' => 'another.route.name']));
136136```
137137
@@ -147,9 +147,9 @@ $flextype->get('/my-route', 'MyController:method()')
147147
148148#### Example
149149```
150- $ flextype->get('/my-route', 'MyController:method()')
150+ flextype() ->get('/my-route', 'MyController:method()')
151151 ->setName('my.route.name')
152- ->add(new AclAccountsIsUserLoggedInRolesNotInMiddleware(['container' => $flextype,
152+ ->add(new AclAccountsIsUserLoggedInRolesNotInMiddleware([
153153 'roles' => 'admin, moderator'
154154 'redirect' => 'another.route.name']));
155155```
@@ -166,9 +166,9 @@ $flextype->get('/my-route', 'MyController:method()')
166166
167167#### Example
168168```
169- $ flextype->get('/my-route', 'MyController:method()')
169+ flextype() ->get('/my-route', 'MyController:method()')
170170 ->setName('my.route.name')
171- ->add(new AclIsUserLoggedInEmailsNotInMiddleware(['container' => $flextype,
171+ ->add(new AclIsUserLoggedInEmailsNotInMiddleware([
172172173173 'redirect' => 'another.route.name']));
174174```
@@ -185,9 +185,9 @@ $flextype->get('/my-route', 'MyController:method()')
185185
186186#### Example
187187```
188- $ flextype->get('/my-route', 'MyController:method()')
188+ flextype() ->get('/my-route', 'MyController:method()')
189189 ->setName('my.route.name')
190- ->add(new AclIsUserLoggedInUuidNotInMiddleware(['container' => $flextype,
190+ ->add(new AclIsUserLoggedInUuidNotInMiddleware([
191191 'uuids' => 'ea7432a3-b2d5-4b04-b31d-1c5acc7a55e2, d549af27-79a0-44f2-b9b1-e82b47bf87e2'
192192 'redirect' => 'another.route.name']));
193193```
@@ -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->container ('acl')->isUserLoggedIn()) {
516+ if (flextype('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->container ('acl')->isUserLoggedInRolesIn('admin, student')) {
524+ if (flextype('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->container ('acl')->isUserLoggedInUuidIn('ea7432a3-b2d5-4b04-b31d-1c5acc7a55e2, d549af27-79a0-44f2-b9b1-e82b47bf87e2') {
532+ if (flextype('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
->container ('acl')->isUserLoggedInEmailIn('
[email protected] ,
[email protected] ')) {
540+ if (flextype('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->container ('acl')->getUserLoggedInEmail();
548+ echo 'Hello ' . flextype('acl')->getUserLoggedInEmail();
549549```
550550
551551#### Show logged in uuid
552552
553553``` php
554- echo 'Hello ' . $ flextype->container ('acl')->getUserLoggedInEmail();
555- echo 'your uuid: ' . $ flextype->container ('acl')->getUserLoggedInUuid();
554+ echo 'Hello ' . flextype('acl')->getUserLoggedInEmail();
555+ echo 'your uuid: ' . flextype('acl')->getUserLoggedInUuid();
556556```
557557
558558#### Show logged in roles
559559
560560``` php
561- echo 'Hello ' . $ flextype->container ('acl')->getUserLoggedInEmail();
562- echo 'your uuid: ' . $ flextype->container ('acl')->getUserLoggedInUuid();
563- echo 'and your roles: ' . $ flextype->container ('acl')->getUserLoggedInRoles();
561+ echo 'Hello ' . flextype('acl')->getUserLoggedInEmail();
562+ echo 'your uuid: ' . flextype('acl')->getUserLoggedInUuid();
563+ echo 'and your roles: ' . flextype('acl')->getUserLoggedInRoles();
564564```
565565
566566## LICENSE
0 commit comments