Skip to content

Instantly share code, notes, and snippets.

@inem
Created March 18, 2014 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inem/9620193 to your computer and use it in GitHub Desktop.
Save inem/9620193 to your computer and use it in GitHub Desktop.
class Verifier
attr_accessor :object, :user
def initialize(object, user)
@object = object
@user = user
end
def access_allowed?
if @user.class == Run
@object.user == @user
elsif @user.class == User
@object == @user
end
end
end
v = Verifier.new(run, current_user)
v.access_allowed?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment