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
|
||||
def show?
|
||||
account&.superuser?
|
||||
record.person.account.nil? && account&.superuser?
|
||||
end
|
||||
|
||||
def create?
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
<% if policy([:staff,
|
||||
@person,
|
||||
]).show? %>
|
||||
AccountConnectionLink.new(@person)]).show? %>
|
||||
<br/>
|
||||
|
||||
<small>
|
||||
|
|
|
@ -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
|
||||
|
|
Reference in a new issue