rosa-build/app/policies/user_policy.rb

45 lines
739 B
Ruby
Raw Normal View History

2015-03-12 22:43:13 +00:00
class UserPolicy < ApplicationPolicy
def show?
true
end
def update?
2015-03-26 23:52:57 +00:00
is_admin? || record == user
end
alias_method :notifiers?, :update?
alias_method :show_current_user?, :update?
alias_method :write?, :update?
2015-05-20 22:03:08 +01:00
# Public: Get list of parameters that the user is allowed to alter.
#
# Returns Array
def permitted_attributes
%i(
company
current_password
delete_avatar
email
hide_email
language
location
login
name
password
password_confirmation
professional_experience
remember_me
site
sound_notifications
uname
)
end
class Scope < Scope
def show
scope
end
end
2015-03-12 22:43:13 +00:00
end