about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-04-28 09:43:34 +0200
committerGitHub <noreply@github.com>2020-04-28 09:43:34 +0200
commitb40d68cc310ada47b498dcde32e025162d9df8b9 (patch)
tree739c391348d35d98738a3e1a1d95d9ea97652a54 /app/serializers
parent157850577ffbf2c5d1496fde361d68a3e293a6ed (diff)
Add `invites_enabled` to API (#13501)
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/rest/instance_serializer.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/serializers/rest/instance_serializer.rb b/app/serializers/rest/instance_serializer.rb
index 1bd71683c..b388e448e 100644
--- a/app/serializers/rest/instance_serializer.rb
+++ b/app/serializers/rest/instance_serializer.rb
@@ -5,7 +5,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
 
   attributes :uri, :title, :short_description, :description, :email,
              :version, :urls, :stats, :thumbnail,
-             :languages, :registrations, :approval_required
+             :languages, :registrations, :approval_required, :invites_enabled
 
   has_one :contact_account, serializer: REST::AccountSerializer
 
@@ -63,6 +63,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
     Setting.registrations_mode == 'approved'
   end
 
+  def invites_enabled
+    Setting.min_invite_role == 'user'
+  end
+
   private
 
   def instance_presenter