Skip to content

Instantly share code, notes, and snippets.

@svisamsetty
Created April 12, 2014 14:11
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 svisamsetty/10537566 to your computer and use it in GitHub Desktop.
Save svisamsetty/10537566 to your computer and use it in GitHub Desktop.
class TaskPolicy < Struct.new(:user, :task)
class Scope < Struct.new(:user, :scope)
def resolve
if user.admin?
scope.all
else
#scope.workpackage.projec
end
end
end
def update?
user.admin? or not post.published?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment