Skip to content

Commit 5cafa74

Browse files
committed
find_records_with_rbac raises exception if ids contains nil
1 parent 0825cd3 commit 5cafa74

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/controllers/mixins/checked_id_mixin.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def find_record_with_rbac(klass, id, options = {})
123123
# either sets flash or raises exception
124124
#
125125
def find_records_with_rbac(klass, ids, options = {})
126+
raise(_("Can't access records without id")) if ids.include?(nil) || ids.empty?
126127
filtered = Rbac.filtered(klass.where(:id => ids), :named_scope => options[:named_scope])
127128
raise(_("Can't access selected records")) unless ids.length == filtered.length
128129
filtered

0 commit comments

Comments
 (0)