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

Fixes cancan validation for :reports #19

Merged
merged 2 commits into from
Feb 18, 2020
Merged

Fixes cancan validation for :reports #19

merged 2 commits into from
Feb 18, 2020

Conversation

memotoro
Copy link
Contributor

Hello.

I have an issue with solidus_reports. The class configuration has an array for the list of tabs within this menu REPORT_TABS ||= [:reports].freeze. The cancan validation is can?(:admin, REPORT_TABS) . However, I have an admin user with only that permission applied ReportDisplay and the menu is not visible. It works for the main admin user though. If I change the cancan validation to can?(:admin, :reports) it works for both. I'm not sure if the cancan validation is wrong as it is applied to an array REPORT_TABS and not the symbol :reports ?. The rest of the solidus core permissions are against a particular class name. This is the only case where the cancan validation is against an array.

Regards

@memotoro memotoro closed this Dec 19, 2019
@memotoro memotoro reopened this Dec 19, 2019
@codecov
Copy link

codecov bot commented Dec 20, 2019

Codecov Report

Merging #19 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #19   +/-   ##
=======================================
  Coverage   95.58%   95.58%           
=======================================
  Files           5        5           
  Lines          68       68           
=======================================
  Hits           65       65           
  Misses          3        3
Impacted Files Coverage Δ
app/models/solidus_reports/configuration.rb 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 251d871...dcd9712. Read the comment docs.

@stale
Copy link

stale bot commented Feb 18, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Feb 18, 2020
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

👍 that should not be an array!

@stale stale bot removed the wontfix This will not be worked on label Feb 18, 2020
@kennyadsl kennyadsl merged commit dce88c6 into solidusio-contrib:master Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants