Skip to content

Commit

Permalink
Merge pull request #1025 from sul-dlss/ability_feature
Browse files Browse the repository at this point in the history
Use the CocinaAbility if the cocina feature flag is enabled
  • Loading branch information
jcoyne authored Nov 8, 2023
2 parents e10e202 + 86f1c5a commit 95f05f2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,13 @@ def rescue_can_can(exception)

render file: "#{Rails.root}/public/403.html", status: :forbidden, layout: false
end

# Overriding CanCan::ControllerAdditions
def current_ability
@current_ability ||= ability_class.new(current_user)
end

def ability_class
Settings.features.cocina ? CocinaAbility : Ability
end
end

0 comments on commit 95f05f2

Please sign in to comment.