Skip to content

Commit

Permalink
fix api permission. #687
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Dec 15, 2020
1 parent 6ce30b6 commit 01e64e5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/serializers/repository_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ class RepositorySerializer
object.password.present?
end

attribute :system_email,
if:
Proc.new { |object, params|
params[:current_ability] &&
params[:current_ability].can?(
:read_contact_information,
object,
) ==
true
} do |object|
object.system_email
end

attribute :service_email,
if:
Proc.new { |object, params|
Expand Down

0 comments on commit 01e64e5

Please sign in to comment.