Skip to content

[MAGETWO-54158]:+ Corrected ACL rules for the sendfriend module and s… #9628

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

Closed
wants to merge 3 commits into from

Conversation

jspoe
Copy link

@jspoe jspoe commented May 13, 2017

Description

Added an acl.xml to the send-friend module
Added upgrade data script for backward compatibility for ACL-roles that were already selected for users.

Changed the acl.xml for the backend module
Added upgrade data script for backward compatibility for ACL-roles that were already selected for users.

Fixed Issues (if relevant)

  1. magento/magento2#MAGETWO-54158: ACL not defined for Magento_Backend::web

Manual testing scenarios

  1. Install Magento latest develop version
  2. Go to Admin side
  3. Click "System > User Roles"
  4. Click "Add new Role" enter Role name
  5. In left side choose Role Resources and check "Dashboard", "Web Section", "Email to a friend", "Currency Setup", "Store E-mail addresses"
  6. Save Role
  7. Click "System > All Users"
  8. Click "Add new User"
  9. Enter data in required fields
  10. In left side click "User Role" and choose early created role.
  11. Click "Save"
  12. Sign out and Log in using credentials of new user
  13. Click "Stores > Configuration"

Expected result:
All the tabs that were selected in the role should be visible

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented May 13, 2017

CLA assistant check
All committers have signed the CLA.

@ishakhsuvarov ishakhsuvarov added this to the May 2017 milestone May 20, 2017
* @param ModuleDataSetupInterface $setup
* @return void
*/
protected function upgradeAcl(ModuleDataSetupInterface $setup)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason for this method is protected? Looks like private is more suitable in this case.

class UpgradeData implements UpgradeDataInterface
{

/**
Copy link
Contributor

Choose a reason for hiding this comment

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

{@inheritdoc} is sufficient in this case.

}

/**
* @param ModuleDataSetupInterface $setup
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to add a comment which explains background under this action.

@@ -12,16 +12,15 @@
<resource id="Magento_Backend::stores">
<resource id="Magento_Backend::stores_settings">
<resource id="Magento_Config::config" title="Configuration" translate="title" sortOrder="20">
<resource id="Magento_Config::advanced" title="Advanced Section" translate="title" sortOrder="90" />
<resource id="Magento_Backend::advanced" title="Advanced Section" translate="title" sortOrder="90" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you consider introducing these resources in the Backend/etc/acl.xml?

* @param ModuleDataSetupInterface $setup
* @return void
*/
protected function upgradeAcl(ModuleDataSetupInterface $setup)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please consider making this method private

@ishakhsuvarov
Copy link
Contributor

Hi @jspoe
Would you like to continue work on this PR or should someone else pick it up?

@jspoe
Copy link
Author

jspoe commented May 29, 2017

Hi @ishakhsuvarov

Thank you for your feedback!
I will pickup the requested changes in a couple of days. Should not take a lot of time.

@okorshenko okorshenko modified the milestones: May 2017, June 2017 Jun 1, 2017
+ Made setup functions private
+ Moved Backend ACL nodes to Backend module instead of Config module
@ishakhsuvarov
Copy link
Contributor

@jspoe Thanks, we will proceed with review shortly.

@ishakhsuvarov
Copy link
Contributor

@jspoe It looks like these changes introduce some unwanted dependencies between the modules in question. We will look into possible solution and let you know how we can fix it.

@jspoe
Copy link
Author

jspoe commented Jun 14, 2017

Yes I understand. It is either part of the Magento_Config module or the Magento_Backend module.
It should not be both. Then there is also the part of the setup script where there is a (small) dependency for to map the roles for backward compatibility.

Please let me know as soon as possible if I can fix this in a better way for you.

@ishakhsuvarov
Copy link
Contributor

@jspoe Looks like the best solution in this case would be to move upgrade scripts to the specifically created modules, something like SendfriendAcl or SendfriendAuthorization, which would have correct dependencies and would allow other modules to be disabled/removed safely.
Would you like to continue on that, since it is some more work to do, or do you want someone else to pick up?
Thanks!

@jspoe
Copy link
Author

jspoe commented Jun 14, 2017

Hi @ishakhsuvarov,

I agree, and I will pick up the requests myself if possible.
I will push a change as soon as I can.

Thanks!

@ishakhsuvarov
Copy link
Contributor

@jspoe Thank you

@ishakhsuvarov
Copy link
Contributor

@jspoe I am closing this PR for now due to inactivity. Please feel free to update and reopen whenever you wish to continue work on it.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants