Skip to content
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

Merged
merged 5 commits into from Dec 10, 2018

Conversation

mikadamczyk
Copy link
Contributor

@mikadamczyk mikadamczyk commented Nov 27, 2018

Question Answer
Tickets https://jira.ez.no/browse/EZP-29744
Bug fix? no
New feature? yes
BC breaks? no
Tests pass? yes
Doc needed? no
License GPL-2.0

Requires: ezsystems/ezplatform-admin-ui-modules#116

Checklist:

  • Coding standards ($ composer fix-cs)
  • Ready for Code Review

@mikadamczyk
Copy link
Contributor Author

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() }}"
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does

Copy link
Contributor

@ViniTou ViniTou left a 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 ;)

Copy link

@katarzynazawada katarzynazawada left a 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.



  1. Create a user with Content/Create policy with Language limitation - select new language.
  2. 
Log in.

  3. 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

  1. Create a user with Content/Create policy with Section limitation - select Standard.
  2. Log in.

  3. 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
Copy link
Contributor

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

@lserwatka lserwatka merged commit f5c89ec into master Dec 10, 2018
@lserwatka lserwatka deleted the EZP-29744 branch December 10, 2018 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
8 participants