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
|
|
|
|
2015-04-09 00:06:55 +01:00
|
|
|
def create?
|
|
|
|
!user.guest?
|
2015-03-23 23:24:27 +00:00
|
|
|
end
|
2015-04-09 00:06:55 +01:00
|
|
|
alias_method :update?, :create?
|
2015-03-23 23:24:27 +00:00
|
|
|
|
2015-04-27 22:16:35 +01:00
|
|
|
# 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
|