From 35588d09e2fb720542f45fcc3a75c9c7c9f8d0a4 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 23 Jun 2022 23:12:01 +0200 Subject: Add /api/v1/admin/domain_allows (#18668) - `GET /api/v1/admin/domain_allows` lists allowed domains - `GET /api/v1/admin/domain_allows/:id` shows one by ID - `DELETE /api/v1/admin/domain_allows/:id` deletes a given domain from the list of allowed domains - `POST /api/v1/admin/domain_allows` to allow a new domain: if that domain is already allowed, the existing DomainAllow will be returned --- app/policies/domain_allow_policy.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/policies') diff --git a/app/policies/domain_allow_policy.rb b/app/policies/domain_allow_policy.rb index 5030453bb..7a5b5d780 100644 --- a/app/policies/domain_allow_policy.rb +++ b/app/policies/domain_allow_policy.rb @@ -1,6 +1,14 @@ # frozen_string_literal: true class DomainAllowPolicy < ApplicationPolicy + def index? + admin? + end + + def show? + admin? + end + def create? admin? end -- cgit