Skip to content

Commit

Permalink
Only check ability if we have it passed in
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhallett committed Oct 30, 2018
1 parent 6d62874 commit 137e38e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/serializers/doi_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class DoiSerializer

attribute :landing_page, if: Proc.new {
|object, params|
params && params[:current_ability].can?(:read_landing_page_results, object) == true
params[:current_ability] && params[:current_ability].can?(:read_landing_page_results, object) == true
} do |object|
{ status: object.last_landing_page_status,
"content-type" => object.last_landing_page_content_type,
Expand Down

0 comments on commit 137e38e

Please sign in to comment.