Closed akshaysasidrn closed 4 years ago
@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.
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.
Implementation for #9