Secure app with user permissions; add specs to confirm permissions are configured correctly

@apps = current_user.apps produces error NoMethodError undefined method `apps' for nil:NilClass

On Jul 13, 2014, at 7:51 AM, Oliver Azevedo Barnes <notifications@github.com> wrote:

> In app/policies/app_policy.rb:
> 
> > @@ -0,0 +1,35 @@
> > + class AppPolicy < ApplicationPolicy
> > +
> > +  def index?
> > +    user.present? && (record.user == user)
> Which record is being checked? At the apps_controller, index isn't using authorize(), so this is not barfing. I think the appropriate here is would be just check for user presence, and then at the controller level, do
> 
> @apps = current_user.apps
> —
> Reply to this email directly or view it on GitHub.
>