2014-07-05 12:59:42 +00:00
|
|
|
class UserPolicy < ApplicationPolicy
|
|
|
|
|
|
|
|
class Scope < Struct.new(:user, :scope)
|
|
|
|
def resolve
|
|
|
|
scope
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-04-28 13:11:19 +00:00
|
|
|
def permitted_attributes
|
2015-05-10 16:40:39 +00:00
|
|
|
[:username, :name, :email, :theme_name, :asciicasts_private_by_default]
|
2015-04-28 13:11:19 +00:00
|
|
|
end
|
|
|
|
|
2014-07-05 12:59:42 +00:00
|
|
|
def update?
|
|
|
|
record == user
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|