New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EZP-29744: Implement permissions for Content/Create in Sub-items table #725
Conversation
backend part is ready to review |
@@ -68,7 +68,8 @@ | |||
<h2 class="ez-fieldgroup__name">{{ 'content.view.subitems'|trans|desc('Sub-items') }}</h2> | |||
<div class="ez-sil" | |||
data-location="{{ location.id }}" | |||
data-items="{{ subitems_module.items }}" | |||
data-mfu-can-create="{{ content_create_permissions_for_mfu|json_encode() }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does data-mfu-can-create
store contentCreatePermissionsConfig
, which is an object? If so, I would rename this data-attribute to e.g. data-mfu-create-permissions-config
, which for me is more precise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just not fan of the MFU abbreviation ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Policy Content/Create with Language limitation
Precondition: New language is added.
- Create a user with Content/Create policy with Language limitation - select new language.
- Log in.
- Go to Content/Content structure
Upload button in the sub-items table is disabled, cannot drag ang drop any files. Create button in context menu is enabled.
Policy Content/Create with Section limitation
- Create a user with Content/Create policy with Section limitation - select Standard.
- Log in.
- Go to Content/Content structure
Upload button in the sub-items table is disabled although eZ Platform folder is assigned to Standard Section
* @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException | ||
* @throws \eZ\Publish\API\Repository\Exceptions\NotFoundException | ||
*/ | ||
private function supplyContentCreatePermissionsForMFU(ContentView $view): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are hiding quite complicated logic in controller. Better place for your code is in \EzSystems\EzPlatformAdminUi\UI\Config\Provider\Module\SubItemsList
c7ac1f5
to
b07f2b5
Compare
…e - change name of data attribute
…e - move logic to another class
b07f2b5
to
7d17b8c
Compare
Requires: ezsystems/ezplatform-admin-ui-modules#116
Checklist:
$ composer fix-cs
)