-
-
Save stabenfeldt/5c63d5a133fb1ab3ec41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/models/spree/custom_ability.rb | |
module Spree | |
class CustomAbility | |
include CanCan::Ability | |
def initialize(user) | |
can [:action], Spree.user_class, id: user.id | |
end | |
end | |
end | |
# config/initializers/spree.rb | |
Spree::Ability.register_ability(Spree::CustomAbility) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment