Restrict options based on group membership

In a form.erb.yml I have a dropdown selection for available partitions, looking something like this
partition:
label: “Partition”
widget: select
options:
- [ ‘short’, ‘short’, select_partition: ‘Partition Name’ ]

- [ ‘unlimited’, ‘unlimited’, select_partition: ‘Partition Name’ ]
- [ ‘debug’, ‘debug’, select_partition: ‘Partition Name’ ]
What I want to do is hide the debug partition for everybody other than users in a particular AD group. I think that the CurrentUser class defined in /var/www/ood/apps/sys/dashboard/lib/current_user.rb will likely give the structure I need. What I’m lost on is how to modify form.yml.erb to do something like
<%= if CurrentUser.groups.include?(‘debugusers’) %>
- [ ‘debug’, ‘debug’, select_partition: ‘Partition Name’ ]
<%= endif %>

I am getting syntax errors on all of my attempts. Where am I going wrong?

Can you share your full form.yml.erb I can take a look.

At a glance - the endif portion is wrong. It should be <% end %> - just end (not endif) and no =.