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

Removed before_filter from controllers for giving users more control #121

Closed
wants to merge 3 commits into from

Conversation

akshaysasidrn
Copy link
Contributor

@akshaysasidrn akshaysasidrn commented Sep 12, 2017

Implementation for #9

@akshaysasidrn
Copy link
Contributor Author

akshaysasidrn commented Sep 12, 2017

@iffyuva I'm not sure about the approach that is taken. Rapidfire makes use of current_user for storing user data in Attempt model and can_administer? to check whether the user is authorizable and also for conditional links in views.

Now that pundit is added, Rapidfire views and authorization is dependant on user model which implies the consumer that uses the gem has to add can_administer? method for their user model.

I think the earlier approach was good. Giving the consumer a helper which he defines and we could simply move the before_filter :authenticate_user! to the controller actions. The functionality of pundit in scoping the records or denying authorization based on the attribute of a record is not used. We are only dependant on a single admin role.

@akshaysasidrn akshaysasidrn force-pushed the issue-9-before-filter-removal branch 2 times, most recently from 30f2570 to b0ccf37 Compare September 12, 2017 15:56
@iffyuva iffyuva self-requested a review November 11, 2018 15:13
@stale
Copy link

stale bot commented Aug 28, 2019

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

@stale stale bot added the stale/wontfix label Aug 28, 2019
@stale stale bot closed this Sep 11, 2019
@iffyuva iffyuva deleted the issue-9-before-filter-removal branch April 2, 2023 14:37
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.

1 participant