Fixed issue #1810: To high permissions required to move Ticket into Group (change) and receive notification about changes (full).
This commit is contained in:
parent
8005d3aee5
commit
196672c50e
3 changed files with 10 additions and 14 deletions
|
@ -98,11 +98,7 @@ returns
|
|||
|
||||
filter[:group_id] = []
|
||||
groups = if params[:current_user].permissions?('ticket.agent')
|
||||
if params[:ticket].present?
|
||||
params[:current_user].groups_access(%w[change])
|
||||
else
|
||||
params[:current_user].groups_access(%w[create])
|
||||
end
|
||||
params[:current_user].groups_access(%w[create change])
|
||||
else
|
||||
Group.where(active: true)
|
||||
end
|
||||
|
|
|
@ -49,7 +49,7 @@ class Transaction::Notification
|
|||
recipients_reason = {}
|
||||
|
||||
# loop through all users
|
||||
possible_recipients = User.group_access(ticket.group_id, 'full').sort_by(&:login)
|
||||
possible_recipients = User.group_access(ticket.group_id, 'read').sort_by(&:login)
|
||||
|
||||
# apply owner
|
||||
if ticket.owner_id != 1
|
||||
|
|
|
@ -140,10 +140,10 @@ class TicketScreenOptionsTest < ActiveSupport::TestCase
|
|||
assert(result[:form_meta][:filter][:type_id])
|
||||
assert_equal([], result[:form_meta][:filter][:type_id].sort)
|
||||
assert(result[:form_meta][:filter][:group_id])
|
||||
assert_equal([group1.id, group3.id], result[:form_meta][:filter][:group_id].sort)
|
||||
assert_equal([group1.id, group2.id, group3.id], result[:form_meta][:filter][:group_id].sort)
|
||||
assert(result[:form_meta][:dependencies])
|
||||
assert(result[:form_meta][:dependencies][:group_id])
|
||||
assert_equal(3, result[:form_meta][:dependencies][:group_id].count)
|
||||
assert_equal(4, result[:form_meta][:dependencies][:group_id].count)
|
||||
assert(result[:form_meta][:dependencies][:group_id][''])
|
||||
assert(result[:form_meta][:dependencies][:group_id][''][:owner_id])
|
||||
assert_equal([], result[:form_meta][:dependencies][:group_id][''][:owner_id])
|
||||
|
@ -182,10 +182,10 @@ class TicketScreenOptionsTest < ActiveSupport::TestCase
|
|||
assert(result[:form_meta][:filter][:type_id])
|
||||
assert_equal([], result[:form_meta][:filter][:type_id].sort)
|
||||
assert(result[:form_meta][:filter][:group_id])
|
||||
assert_equal([group1.id, group3.id], result[:form_meta][:filter][:group_id].sort)
|
||||
assert_equal([group1.id, group2.id, group3.id], result[:form_meta][:filter][:group_id].sort)
|
||||
assert(result[:form_meta][:dependencies])
|
||||
assert(result[:form_meta][:dependencies][:group_id])
|
||||
assert_equal(3, result[:form_meta][:dependencies][:group_id].count)
|
||||
assert_equal(4, result[:form_meta][:dependencies][:group_id].count)
|
||||
assert(result[:form_meta][:dependencies][:group_id][''])
|
||||
assert(result[:form_meta][:dependencies][:group_id][''][:owner_id])
|
||||
assert_equal([], result[:form_meta][:dependencies][:group_id][''][:owner_id])
|
||||
|
@ -467,10 +467,10 @@ class TicketScreenOptionsTest < ActiveSupport::TestCase
|
|||
Ticket::Article::Type.lookup(name: 'note').id,
|
||||
], result[:form_meta][:filter][:type_id].sort)
|
||||
assert(result[:form_meta][:filter][:group_id])
|
||||
assert_equal([group1.id, group2.id], result[:form_meta][:filter][:group_id].sort)
|
||||
assert_equal([group1.id, group2.id, group3.id], result[:form_meta][:filter][:group_id].sort)
|
||||
assert(result[:form_meta][:dependencies])
|
||||
assert(result[:form_meta][:dependencies][:group_id])
|
||||
assert_equal(3, result[:form_meta][:dependencies][:group_id].count)
|
||||
assert_equal(4, result[:form_meta][:dependencies][:group_id].count)
|
||||
assert(result[:form_meta][:dependencies][:group_id][''])
|
||||
assert(result[:form_meta][:dependencies][:group_id][''][:owner_id])
|
||||
assert_equal([], result[:form_meta][:dependencies][:group_id][''][:owner_id])
|
||||
|
@ -513,10 +513,10 @@ class TicketScreenOptionsTest < ActiveSupport::TestCase
|
|||
Ticket::Article::Type.lookup(name: 'note').id,
|
||||
], result[:form_meta][:filter][:type_id].sort)
|
||||
assert(result[:form_meta][:filter][:group_id])
|
||||
assert_equal([group1.id, group2.id], result[:form_meta][:filter][:group_id].sort)
|
||||
assert_equal([group1.id, group2.id, group3.id], result[:form_meta][:filter][:group_id].sort)
|
||||
assert(result[:form_meta][:dependencies])
|
||||
assert(result[:form_meta][:dependencies][:group_id])
|
||||
assert_equal(3, result[:form_meta][:dependencies][:group_id].count)
|
||||
assert_equal(4, result[:form_meta][:dependencies][:group_id].count)
|
||||
assert(result[:form_meta][:dependencies][:group_id][''])
|
||||
assert(result[:form_meta][:dependencies][:group_id][''][:owner_id])
|
||||
assert_equal([], result[:form_meta][:dependencies][:group_id][''][:owner_id])
|
||||
|
|
Loading…
Reference in a new issue