diff --git a/app/assets/templates/admin/members/edit.html.erb b/app/assets/templates/admin/members/edit.html.erb index 34d107c4d..d40d90e04 100644 --- a/app/assets/templates/admin/members/edit.html.erb +++ b/app/assets/templates/admin/members/edit.html.erb @@ -76,8 +76,13 @@

{{ 'app.admin.members_edit.price_' | translate }} {{ subscription.plan.amount | currency}}

- - +
+ + +
+

+ {{ 'app.admin.members_edit.cannot_extend_own_subscription' }} +

diff --git a/app/policies/subscription_policy.rb b/app/policies/subscription_policy.rb index a6866fb6c..e556189a0 100644 --- a/app/policies/subscription_policy.rb +++ b/app/policies/subscription_policy.rb @@ -12,6 +12,6 @@ class SubscriptionPolicy < ApplicationPolicy end def update? - user.admin? + user.admin? || (user.manager? && record.user.id != user.id) end end diff --git a/config/locales/app.admin.en.yml b/config/locales/app.admin.en.yml index 0e18ec292..7a844b900 100644 --- a/config/locales/app.admin.en.yml +++ b/config/locales/app.admin.en.yml @@ -763,6 +763,7 @@ en: wallet: "Wallet" to_credit: 'Credit' cannot_credit_own_wallet: "You cannot credit your own wallet. Please ask another manager or an administrator to credit your wallet." + cannot_extend_own_subscription: "You cannot extend your own subscription. Please ask another manager or an administrator to extend your subscription." #add a new administrator to the platform admins_new: add_an_administrator: "Add an administrator"