Restrict making SIP account

Stephen Paul Weber created

Change summary

sgx_jmp.rb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Detailed changes

sgx_jmp.rb 🔗

@@ -815,7 +815,11 @@ Command.new(
 	"☎️ Create or Reset SIP Account",
 	customer_repo: CustomerRepo.new(sgx_repo: Bwmsgsv2Repo.new)
 ) {
-	Command.customer.then do |customer|
+	Command.customer.then { |customer|
+		TrustLevelRepo.new.find(customer).then { |tl| [customer, tl] }
+	}.then do |(customer, tl)|
+		raise "Please contact JMP support" unless tl.support_call?(0, 1, :outbound)
+
 		sip_account = customer.reset_sip_account
 		Command.reply { |reply|
 			reply.allowed_actions = [:next]