padma-assets 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c6c0e4404edbb4641adb4be29c775a4510002c70
4
- data.tar.gz: c7b33edbea9a3a408280f2a099600595c194fe2c
3
+ metadata.gz: 856bdd472b827470988adcaee5e9ff2418d97ee2
4
+ data.tar.gz: 723a3d940d839bf9ecfd50abfa4a4e2e59454337
5
5
  SHA512:
6
- metadata.gz: 958cbbe5c7e1a584bce3a16877ae789f978cfb33d1ea74ea995fabf702d204341f7ead231a9e91c9b139e22ccb2d1281c3e6e1cb49e9d480c088fd6ee9f61954
7
- data.tar.gz: 63d3768c45fc19e99b1645de605e7cf36e6428dcf71ff7396bee2e09c6f6b8b4e8048f4ea93117845e5c1d36ee3b2ff0099c226983dfcac7763c896041311066
6
+ metadata.gz: 40eb5004bded6ed069cb9c0db4e2a174db41e9d8c3a8693f377b3240a594b11906fe01ffa395109ffebad90ac1b59b93d487c43dce196a7c7d92abf2fd1459b7
7
+ data.tar.gz: 3ead87d490809153a6be575295583618681f064e4c6814a36625f6bd05b2ac450530bf30e23076eeb5618d4dd4bd6b34ed3fbf0c95f5959cd489c0c2e8ab609b
@@ -3,7 +3,10 @@ class GeneralAbility
3
3
 
4
4
  def initialize(user)
5
5
  if alpha?(user)
6
- can :manage, :mailchimp
6
+ can :see, :mailchimp
7
+ if petal_enabled?(user,'mailchimp')
8
+ can :configure, :mailchimp
9
+ end
7
10
  can :manage, :planning
8
11
  end
9
12
 
@@ -34,6 +37,10 @@ class GeneralAbility
34
37
  user.current_account.padma
35
38
  end
36
39
  end
40
+
41
+ def petal_enabled?(user,petal_name)
42
+ petal_name.in?(padma_account(user).enabled_petals||[])
43
+ end
37
44
 
38
45
  def alpha?(user)
39
46
  user.account_tester_level == 'alpha'
@@ -2,6 +2,6 @@
2
2
  <li><%= link_to t('header-menu.mailing.triggers'), "#{APP_CONFIG['mailing-url']}/triggers" %></li>
3
3
  <li><%= link_to t('header-menu.mailing.scheduled_mails_all'), "#{APP_CONFIG['mailing-url']}/scheduled_mails/history" %></li>
4
4
  <li><%= link_to t('header-menu.mailing.scheduled_mails_future'), "#{APP_CONFIG['mailing-url']}/scheduled_mails/pending" %></li>
5
- <% if 'mailchimp'.in?(current_user.current_account.padma.enabled_petals||[]) -%>
5
+ <% if can? :configure, :mailchimp -%>
6
6
  <li><%= link_to t('header-menu.mailing.mailchimp_configuration'), "#{APP_CONFIG['mailing-url']}/mailchimp/configuration" %></li>
7
7
  <% end -%>
@@ -50,7 +50,7 @@
50
50
  <% if can?(:manage,:planning) -%>
51
51
  <li><%= link_to t('header-menu.modules.planning'), APP_CONFIG['planning-url'] %></li>
52
52
  <% end -%>
53
- <% if can?(:manage, :mailchimp) -%>
53
+ <% if can?(:see, :mailchimp) -%>
54
54
  <li><%= link_to t('header-menu.modules.mailchimp_integration'), "#{APP_CONFIG['mailing-url']}/mailchimp/subscription" %></li>
55
55
  <% end -%>
56
56
  <% if can?(:manage, :derose_events) -%>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: padma-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dwayne Macgowan