Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
aldesantis committed Oct 8, 2020
1 parent 4bafb31 commit 4dcb253
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
7 changes: 0 additions & 7 deletions config/initializers/permission_sets.rb

This file was deleted.

3 changes: 3 additions & 0 deletions lib/solidus_subscriptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
require 'state_machines'

require 'solidus_subscriptions/configuration'
require 'solidus_subscriptions/ability'
require 'solidus_subscriptions/permission_sets/subscription_management'
require 'solidus_subscriptions/permitted_attributes'
require 'solidus_subscriptions/processor'
require 'solidus_subscriptions/version'
require 'solidus_subscriptions/engine'

Expand Down
10 changes: 10 additions & 0 deletions lib/solidus_subscriptions/ability.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

module SolidusSubscriptions
class Ability
include CanCan::Ability

def initialize(user)
end
end
end
13 changes: 10 additions & 3 deletions lib/solidus_subscriptions/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
require 'spree/core'

require 'solidus_subscriptions'
require 'solidus_subscriptions/permitted_attributes'
require 'solidus_subscriptions/configuration'
require 'solidus_subscriptions/processor'

module SolidusSubscriptions
class Engine < Rails::Engine
Expand Down Expand Up @@ -47,6 +44,16 @@ class Engine < Rails::Engine
)
end
end

def self.activate
::Spree::Ability.register_ability(SolidusSubscriptions::Ability)

::Spree.config do |config|
config.roles.assign_permissions :default, %w[SolidusSubscriptions::PermissionSets::SubscriptionManagement]
end
end

config.to_prepare(&method(:activate).to_proc)
end

def self.table_name_prefix
Expand Down

0 comments on commit 4dcb253

Please sign in to comment.