Merge branch 'main' into glitch-soc/merge-upstream

Conflicts:
- `app/controllers/api/v1/statuses_controller.rb`:
  Upstream moved things around in a place where glitch-soc had support for
  an extra parameter (`content_type`).
  Follow upstream but reintroduce `content_type`.
This commit is contained in:
Claire
2022-02-10 19:09:27 +01:00
35 changed files with 973 additions and 121 deletions

View File

@@ -137,7 +137,7 @@ RSpec.describe StatusPolicy, type: :model do
end
end
permissions :index?, :update? do
permissions :index? do
it 'grants access if staff' do
expect(subject).to permit(admin.account)
end
@@ -146,4 +146,18 @@ RSpec.describe StatusPolicy, type: :model do
expect(subject).to_not permit(alice)
end
end
permissions :update? do
it 'grants access if staff' do
expect(subject).to permit(admin.account, status)
end
it 'grants access if owner' do
expect(subject).to permit(status.account, status)
end
it 'denies access unless staff' do
expect(subject).to_not permit(bob, status)
end
end
end