Skip to content

Commit

Permalink
Fixes #4704 - Shared drafts in ticket zoom not usable if permission i…
Browse files Browse the repository at this point in the history
…s granted through role assignment.

Co-authored-by: Rolf Schmidt <rolf.schmidt@zammad.com>
  • Loading branch information
fliebe92 and rolfschmidt committed Aug 18, 2023
1 parent 6e71c5b commit 1d7e53e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Expand Up @@ -28,6 +28,6 @@ def import_attachments?
private

def access?(_method)
user.permissions?('ticket.agent') && user.groups.access(:create).any?
user.permissions?('ticket.agent') && user.group_ids_access('create').present?
end
end
Expand Up @@ -36,6 +36,20 @@
let(:action_name) { :index }

include_examples 'basic checks'

context 'when has access through roles' do
let(:role) do
role = create(:role, :agent)
role.group_names_access_map = {
Group.first.name => %w[full],
}
role
end

let(:user) { create(:agent, role_ids: [role.id]) }

it { is_expected.to permit_action(action_name) }
end
end

describe '#show?' do
Expand Down

0 comments on commit 1d7e53e

Please sign in to comment.