Skip to content

Commit 42262c3

Browse files
committed
Merge branch 'master' into dev
2 parents 6c6aaee + 340bc2b commit 42262c3

18 files changed

+64
-193
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
<a name="1.7.0"></a>
2+
# [1.7.0](https://github.com/flextype-plugins/acl) (2020-12-29)
3+
4+
### Features
5+
6+
* **core** update code base for new Flextype 0.9.14
7+
* **core** Moving to PHP 7.4
8+
* **core** use new TWIG Plugin 1.7.0
9+
10+
<a name="1.6.0"></a>
11+
# [1.6.0](https://github.com/flextype-plugins/acl) (2020-12-20)
12+
13+
### Features
14+
15+
* **core** update code base for new Flextype 0.9.13
16+
117
<a name="1.5.0"></a>
218
# [1.5.0](https://github.com/flextype-plugins/acl) (2020-12-06)
319

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<h1 align="center">ACL Plugin for <a href="http://flextype.org/">Flextype</a></h1>
1+
<h1 align="center">ACL Plugin for <a href="https://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.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>
4+
<a href="https://github.com/flextype-plugins/acl/releases"><img alt="Version" src="https://img.shields.io/github/release/flextype-plugins/flextype.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.14-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.12 | [download](https://github.com/flextype/flextype/releases) |
18+
| [flextype](https://github.com/flextype/flextype) | 0.9.14 | [download](https://github.com/flextype/flextype/releases) |
1919
| [twig](https://github.com/flextype-plugins/twig) | >=1.0.0 | [download](https://github.com/flextype-plugins/twig/releases) |
2020

2121
## Installation
@@ -447,7 +447,7 @@ You may restrict access for specific users to your specific content inside the T
447447
#### Show private content for logged in users
448448

449449
```
450-
{% if acl.isUserLoggedIn() %}
450+
{% if flextype.acl.isUserLoggedIn() %}
451451
Private content here..
452452
{% else %}
453453
Public content for users is here...
@@ -457,7 +457,7 @@ You may restrict access for specific users to your specific content inside the T
457457
#### Show private content for users with roles: admin and student
458458

459459
```
460-
{% if acl.isUserLoggedInRolesIn('admin, student') %}
460+
{% if flextype.acl.isUserLoggedInRolesIn('admin, student') %}
461461
Private content here..
462462
{% else %}
463463
Public content for users is here...
@@ -467,7 +467,7 @@ You may restrict access for specific users to your specific content inside the T
467467
#### Show private content for users with uuids ea7432a3-b2d5-4b04-b31d-1c5acc7a55e2 and d549af27-79a0-44f2-b9b1-e82b47bf87e2
468468

469469
```
470-
{% if acl.isUserLoggedInUuidIn('ea7432a3-b2d5-4b04-b31d-1c5acc7a55e2, d549af27-79a0-44f2-b9b1-e82b47bf87e2') %}
470+
{% if flextype.acl.isUserLoggedInUuidIn('ea7432a3-b2d5-4b04-b31d-1c5acc7a55e2, d549af27-79a0-44f2-b9b1-e82b47bf87e2') %}
471471
Private content here..
472472
{% else %}
473473
Public content for users is here...
@@ -477,7 +477,7 @@ You may restrict access for specific users to your specific content inside the T
477477
#### Show private content for users with emails [email protected], [email protected]
478478

479479
```
480-
{% if acl.isUserLoggedInEmailIn('[email protected], [email protected]') %}
480+
{% if flextype.acl.isUserLoggedInEmailIn('[email protected], [email protected]') %}
481481
Public content for users is here...
482482
{% else %}
483483
Public content for users is here...
@@ -487,22 +487,22 @@ You may restrict access for specific users to your specific content inside the T
487487
#### Show logged in email
488488

489489
```
490-
Hello {{ acl.getUserLoggedInEmail() }}
490+
Hello {{ flextype.acl.getUserLoggedInEmail() }}
491491
```
492492

493493
#### Show logged in uuid
494494

495495
```
496-
Hello {{ acl.getUserLoggedInEmail() }},
497-
your uuid: {{ acl.getUserLoggedInUuid() }}
496+
Hello {{ flextype.acl.getUserLoggedInEmail() }},
497+
your uuid: {{ flextype.acl.getUserLoggedInUuid() }}
498498
```
499499

500500
#### Show logged in roles
501501

502502
```
503-
Hello {{ acl.getUserLoggedInEmail() }},
504-
your uuid: {{ acl.getUserLoggedInUuid() }}
505-
and your roles: {{ acl.getUserLoggedInRoles() }}
503+
Hello {{ flextype.acl.getUserLoggedInEmail() }},
504+
your uuid: {{ flextype.acl.getUserLoggedInUuid() }}
505+
and your roles: {{ flextype.acl.getUserLoggedInRoles() }}
506506
```
507507

508508
### Restrict access in the PHP
@@ -564,4 +564,4 @@ echo 'and your roles: ' . flextype('acl')->getUserLoggedInRoles();
564564

565565
## LICENSE
566566
[The MIT License (MIT)](https://github.com/flextype-plugins/acl/blob/master/LICENSE.txt)
567-
Copyright (c) 2020 [Sergey Romanenko](https://github.com/Awilum)
567+
Copyright (c) 2021 [Sergey Romanenko](https://github.com/Awilum)

app/Models/Acl.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@
1919

2020
class Acl
2121
{
22-
/**
23-
* __construct
24-
*/
25-
public function __construct()
26-
{
27-
28-
}
29-
3022
/**
3123
* Check is user logged in
3224
*

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"issues": "https://github.com/flextype-plugins/acl/issues"
1717
},
1818
"require": {
19-
"php": ">=7.3.0",
19+
"php": ">=7.4.0",
2020
"ext-json": "*",
2121
"flextype-components/arrays" : "3.0.1",
2222
"flextype-components/filesystem": "2.0.8"
@@ -25,7 +25,7 @@
2525
"apcu-autoloader": true,
2626
"optimize-autoloader": true,
2727
"platform": {
28-
"php": "7.3.0"
28+
"php": "7.4.0"
2929
}
3030
},
3131
"autoload": {

dependencies.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@
1313

1414
use Flextype\Plugin\Acl\Models\Acl;
1515
use Flextype\Plugin\Acl\Twig\AclTwigExtension;
16+
use Flextype\Plugin\Twig\Twig\FlextypeTwig;
17+
use Flextype\Foundation\Entries\Entries;
18+
use Flextype\Plugin\Twig\Twig\FlextypeEntriesTwig;
19+
1620

1721
/**
1822
* Add ACL Model to Flextype container
1923
*/
20-
flextype()->container()['acl'] = static function () {
21-
return new Acl();
22-
};
24+
flextype()->container()['acl'] = fn() => new Acl();
25+
2326

2427
/**
25-
* Add ACL Twig Extension to Flextype container
28+
* Add ACL Model to Flextype Twig
2629
*/
27-
flextype('twig')->addExtension(new AclTwigExtension());
30+
FlextypeTwig::macro('acl', fn() => flextype('acl'));

entries_acl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66

7-
flextype('emitter')->addListener('onEntryAfterInitialized', function() {
7+
flextype('emitter')->addListener('onEntriesFetchSingleHasResult', function() {
88

99
// Get current entry
1010
$entry = flextype('entries')->getStorage('fetch.data');

middlewares/AclIsUserLoggedInEmailInMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* Flextype (http://flextype.org)
6+
* Flextype (https://flextype.org)
77
* Founded by Sergey Romanenko and maintained by Flextype Community.
88
*/
99

middlewares/AclIsUserLoggedInEmailNotInMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* Flextype (http://flextype.org)
6+
* Flextype (https://flextype.org)
77
* Founded by Sergey Romanenko and maintained by Flextype Community.
88
*/
99

middlewares/AclIsUserLoggedInMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* Flextype (http://flextype.org)
6+
* Flextype (https://flextype.org)
77
* Founded by Sergey Romanenko and maintained by Flextype Community.
88
*/
99

middlewares/AclIsUserLoggedInRolesInMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* Flextype (http://flextype.org)
6+
* Flextype (https://flextype.org)
77
* Founded by Sergey Romanenko and maintained by Flextype Community.
88
*/
99

0 commit comments

Comments
 (0)