From 478987d564e96c123ae243b1f6e089e00df20fcf Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 3 Aug 2015 14:45:16 -0700 Subject: allow_registration should always be false if enrollment_policy is 'closed' --- provider_base/provider.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'provider_base/provider.json') diff --git a/provider_base/provider.json b/provider_base/provider.json index 60ad2a9e..9b6e73ca 100644 --- a/provider_base/provider.json +++ b/provider_base/provider.json @@ -32,7 +32,7 @@ "allow_free": "= provider.service.levels.select {|l| l['rate'].nil?}.any?", "allow_paid": "= provider.service.levels.select {|l| !l['rate'].nil?}.any?", "allow_anonymous": "= provider.service.levels.select {|l| l['name'] == 'anonymous'}.any?", - "allow_registration": "= provider.service.levels.select {|l| l['name'] != 'anonymous'}.any?", + "allow_registration": "= provider.enrollment_policy != 'closed' && provider.service.levels.select {|l| l['name'] != 'anonymous'}.any?", "allow_limited_bandwidth": "= provider.service.levels.select {|l| l['bandwidth'] == 'limited'}.any?", "allow_unlimited_bandwidth": "= provider.service.levels.select {|l| l['bandwidth'].nil?}.any?" }, -- cgit v1.2.3 From e6f6324ebea9fc46d5d617a08c2eb239349d9f90 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 7 Aug 2015 18:08:14 -0700 Subject: move 'enabled service' calculation to a macro. --- provider_base/provider.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'provider_base/provider.json') diff --git a/provider_base/provider.json b/provider_base/provider.json index 9b6e73ca..81b2ea98 100644 --- a/provider_base/provider.json +++ b/provider_base/provider.json @@ -14,6 +14,7 @@ "languages": ["en"], "default_language": "en", "enrollment_policy": "open", + "services": "= enabled_services", "service": { // bandwidth limit is in Bytes, storage limit is in MB. // for example: @@ -31,7 +32,7 @@ "bandwidth_limit": 102400, "allow_free": "= provider.service.levels.select {|l| l['rate'].nil?}.any?", "allow_paid": "= provider.service.levels.select {|l| !l['rate'].nil?}.any?", - "allow_anonymous": "= provider.service.levels.select {|l| l['name'] == 'anonymous'}.any?", + "allow_anonymous": "= provider.service.levels.select {|l| l['name'] == 'anonymous'}.any? && services.include?('openvpn')", "allow_registration": "= provider.enrollment_policy != 'closed' && provider.service.levels.select {|l| l['name'] != 'anonymous'}.any?", "allow_limited_bandwidth": "= provider.service.levels.select {|l| l['bandwidth'] == 'limited'}.any?", "allow_unlimited_bandwidth": "= provider.service.levels.select {|l| l['bandwidth'].nil?}.any?" -- cgit v1.2.3