Skip to content

Commit

Permalink
Merge pull request #2926 from bitzesty/address-permissions-staging
Browse files Browse the repository at this point in the history
Allows superadmins to manage addresses at any time
  • Loading branch information
Lubosky authored May 13, 2024
2 parents 863538a + a8e864d commit ab4828c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/policies/company_detail_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ def can_manage_company_name?
end

def can_manage_address?
admin?
if admin?
record.submitted_and_after_the_deadline? || subject.superadmin?
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
= @form_answer.document["website_url"]
br

- if resource.submitted_and_after_the_deadline? && CompanyDetailPolicy.new(pundit_user, resource).can_manage_address?
- if CompanyDetailPolicy.new(pundit_user, resource).can_manage_address?
= simple_form_for([namespace_name, resource],
remote: true,
authenticity_token: true, html: { data: { type: "html", inline_flash_target: "form" }, id: "address_form_admin_appraisal" }) do |f|
Expand Down Expand Up @@ -259,7 +259,7 @@
= @form_answer.nominator_email
br

- if resource.submitted_and_after_the_deadline? && CompanyDetailPolicy.new(pundit_user, resource).can_manage_address?
- if CompanyDetailPolicy.new(pundit_user, resource).can_manage_address?
= simple_form_for([namespace_name, resource],
remote: true,
authenticity_token: true, html: { data: { type: "html", inline_flash_target: "form" }, id: "address_form_admin_appraisal" }) do |f|
Expand Down

0 comments on commit ab4828c

Please sign in to comment.