asciinema.org/app/policies/user_policy.rb

21 lines
329 B
Ruby
Raw Normal View History

2014-07-05 12:59:42 +00:00
class UserPolicy < ApplicationPolicy
class Scope < Struct.new(:user, :scope)
def resolve
scope
end
end
def permitted_attributes
attrs = [:username, :name, :email, :theme_name]
attrs << :asciicasts_private_by_default if record.supporter?
attrs
end
2014-07-05 12:59:42 +00:00
def update?
record == user
end
end