rosa-build/app/policies/advisory_policy.rb

25 lines
386 B
Ruby
Raw Normal View History

2015-03-12 22:43:13 +00:00
class AdvisoryPolicy < ApplicationPolicy
def index?
true
end
2015-03-19 23:31:41 +00:00
alias_method :search?, :index?
alias_method :show?, :index?
2015-03-12 22:43:13 +00:00
def create?
!user.guest?
end
alias_method :update?, :create?
# Public: Get list of parameters that the user is allowed to alter.
#
# Returns Array
def permitted_attributes
%i(
description
references
)
end
2015-03-12 22:43:13 +00:00
end