Modified: trunk/lib/api/resources/components.rb (3773 => 3774)
--- trunk/lib/api/resources/components.rb 2013-11-11 09:12:31 UTC (rev 3773)
+++ trunk/lib/api/resources/components.rb 2013-11-11 09:16:09 UTC (rev 3774)
@@ -223,7 +223,9 @@
end
# Check if can delete ALL components in family
- component_entries = family.contributable_entries.select { |e| e.contributable_type == 'Workflow' && e.contributable.component? }
+ component_entries = family.contributable_entries.select { |e| e.contributable_type == 'Workflow' &&
+ !e.contributable.nil? &&
+ e.contributable.component? }
components = component_entries.map { |e| e.contributable }
undeletable_components = components.select { |c| !Authorization.check('destroy', c, opts[:user]) }
if undeletable_components.size == 0
@@ -235,7 +237,9 @@
rest_get_request(family, opts[:user], opts[:query])
else
- family.errors.add_to_base("You don't have permission to delete #{undeletable_components.size} components in this component family.")
+ family.errors.add_to_base(
+ "You don't have permission to delete #{undeletable_components.size} components in this component family: " +
+ "#{undeletable_components.map { |c| rest_access_uri(c) }.join(', ')}")
rest_response(401, :object => family)
end
end