Skip to content

Commit

Permalink
Fixed Flex Page CRUD ACL when creating a new page [#115]
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Mar 18, 2021
1 parent bf5ac26 commit 56d6123
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
1. [](#bugfix)
* Fixed broken media upload/picker fields with `@self/path` notations [grav#3275](https://github.com/getgrav/grav/issues/3275)
* Fixed `filepicker` field not including newly uploaded and excluding newly deleted files before saving the object
* Fixed `Flex Page` CRUD ACL when creating a new page [#115](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/115)

# v1.0.4
## 03/17/2021
Expand Down
4 changes: 2 additions & 2 deletions admin/templates/flex-objects/types/pages/edit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
{% set form = form ?? object.form(admin.session.expert != '0' ? 'raw') %}
{% set title = title ?? form.getValue('header.title') ?? object.title ?? key %}
{% set parent = object.parent %}
{% set can_read = can_read ?? (object.exists ? object.isAuthorized('read', 'admin', user) : parent.isAuthorized('create', 'admin', user))|bool %}
{% set can_read = can_read ?? (object.exists ? object.isAuthorized('read', 'admin', user) : object.isAuthorized('create', 'admin', user))|bool %}
{% set can_copy = can_copy ?? (parent.exists and parent.isAuthorized('create', 'admin', user)) %}
{% set can_create = can_create ?? (object.exists and object.isAuthorized('create', 'admin', user)) %}
{% set can_save = can_save ?? (object.exists ? object.isAuthorized('update', 'admin', user) : parent.isAuthorized('create', 'admin', user))|bool %}
{% set can_save = can_save ?? (object.exists ? object.isAuthorized('update', 'admin', user) : object.isAuthorized('create', 'admin', user))|bool %}
{% set can_translate = can_translate ?? (admin.multilang and object.hasFlexFeature('page-translate') and not object.root()) %}

{% macro spanToggle(input, length) %}
Expand Down

0 comments on commit 56d6123

Please sign in to comment.