1
0
Fork 0

Restrict access to some pages

This commit is contained in:
Alex Kotov 2019-09-02 18:37:32 +05:00
parent 015fdf63dc
commit d49f71fb4f
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
3 changed files with 3 additions and 3 deletions

View file

@ -2,7 +2,7 @@
class Staff::Person::AccountConnectionLinkPolicy < ApplicationPolicy
def show?
account&.superuser?
record.person.account.nil? && account&.superuser?
end
def create?

View file

@ -24,7 +24,7 @@
<% if policy([:staff,
@person,
]).show? %>
AccountConnectionLink.new(@person)]).show? %>
<br/>
<small>

View file

@ -29,7 +29,7 @@ RSpec.describe 'GET /staff/people/:person_id/account_connection_link' do
let(:person) { create(:personal_account).person }
specify do
expect(response).to have_http_status :ok
expect(response).to have_http_status :forbidden
end
end
end