Skip to content

Commit

Permalink
use request_admin_user
Browse files Browse the repository at this point in the history
use helper method instead of calling out the miq_request_approval role
(yes, this is being corrected in this commit)

https://bugzilla.redhat.com/show_bug.cgi?id=1608554
  • Loading branch information
kbrock committed Aug 16, 2018
1 parent 0a2c868 commit d4f9835
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class ApplicationHelper::Button::MiqRequestDelete < ApplicationHelper::Button::M

def disabled?
requester = current_user
return false if requester.role_allows?(:feature => "miq_request_superadmin")
return false if requester.miq_user_role.request_admin_user?
@error_message = _("Users are only allowed to delete their own requests") if requester.name != @record.requester_name
if %w(approved denied).include?(@record.approval_state)
@error_message = _("%{approval_states} requests cannot be deleted") %
Expand Down

0 comments on commit d4f9835

Please sign in to comment.