class Spree::PermissionSets::Base
This is the base class used for crafting permission sets.
This is used by {Spree::RoleConfiguration} when adding custom behavior to {Spree::Ability}. See one of the subclasses for example structure such as {Spree::PermissionSets::UserDisplay}
Attributes
ability[R]
Public Class Methods
new(ability)
click to toggle source
@param ability [CanCan::Ability]
The ability that will be extended with the current permission set. The ability passed in must respond to #user
# File lib/spree/permission_sets/base.rb, line 16 def initialize(ability) @ability = ability end
Public Instance Methods
activate!()
click to toggle source
Activate permissions on the ability. Put your can and cannot statements here. Must be overriden by subclasses
# File lib/spree/permission_sets/base.rb, line 22 def activate! raise NotImplementedError.new end