Restrict access to some pages
This commit is contained in:
parent
015fdf63dc
commit
d49f71fb4f
3 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class Staff::Person::AccountConnectionLinkPolicy < ApplicationPolicy
|
class Staff::Person::AccountConnectionLinkPolicy < ApplicationPolicy
|
||||||
def show?
|
def show?
|
||||||
account&.superuser?
|
record.person.account.nil? && account&.superuser?
|
||||||
end
|
end
|
||||||
|
|
||||||
def create?
|
def create?
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
<% if policy([:staff,
|
<% if policy([:staff,
|
||||||
@person,
|
@person,
|
||||||
]).show? %>
|
AccountConnectionLink.new(@person)]).show? %>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<small>
|
<small>
|
||||||
|
|
|
@ -29,7 +29,7 @@ RSpec.describe 'GET /staff/people/:person_id/account_connection_link' do
|
||||||
let(:person) { create(:personal_account).person }
|
let(:person) { create(:personal_account).person }
|
||||||
|
|
||||||
specify do
|
specify do
|
||||||
expect(response).to have_http_status :ok
|
expect(response).to have_http_status :forbidden
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Reference in a new issue