app/services/sufia/admin_set_service.rb in sufia-7.3.0.rc3 vs app/services/sufia/admin_set_service.rb in sufia-7.3.0
- old
+ new
@@ -18,35 +18,7 @@
counts = results['facet_counts']['facet_fields'][join_field].each_slice(2).to_h
documents.map do |doc|
[doc, counts[doc.id]]
end
end
-
- # Return AdminSet selectbox options based on access type
- # @param [Symbol] access :read or :edit
- def select_options(access = :read)
- search_results(access).map do |admin_set|
- [admin_set.to_s, admin_set.id, data_attributes(admin_set)]
- end
- end
-
- private
-
- # Create a hash of HTML5 'data' attributes. These attributes are added to select_options and
- # later utilized by Javascript to limit new Work options based on AdminSet selected
- def data_attributes(admin_set)
- attrs = {}
- # Get permission template associated with this AdminSet (if any)
- permission_template = PermissionTemplate.find_by(admin_set_id: admin_set.id)
-
- # Only add data attributes if permission template exists
- if permission_template
- # Save all PermissionTemplate release & visibility data attributes (if not blank or false)
- attrs['data-release-date'] = permission_template.release_date unless permission_template.release_date.blank?
- attrs['data-release-before-date'] = true if permission_template.release_before_date?
- attrs['data-visibility'] = permission_template.visibility unless permission_template.visibility.blank?
- end
-
- attrs
- end
end
end