Skip to content

Commit

Permalink
Merge pull request ManageIQ#17197 from hstastna/Duplicate_RBAC_Role_G…
Browse files Browse the repository at this point in the history
…roup_names_capitalization

Add case insensitivity when validating uniqueness of name of new group/role
  • Loading branch information
bdunne committed Mar 26, 2018
2 parents ae25cf0 + 4ddb142 commit ad57f99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/miq_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MiqGroup < ApplicationRecord

delegate :self_service?, :limited_self_service?, :disallowed_roles, :to => :miq_user_role, :allow_nil => true

validates :description, :presence => true, :unique_within_region => true
validates :description, :presence => true, :unique_within_region => { :match_case => false }
validate :validate_default_tenant, :on => :update, :if => :tenant_id_changed?
before_destroy :ensure_can_be_destroyed
after_destroy :reset_current_group_for_users
Expand Down
3 changes: 1 addition & 2 deletions app/models/miq_user_role.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class MiqUserRole < ApplicationRecord

virtual_column :vm_restriction, :type => :string

validates_presence_of :name
validates_uniqueness_of :name
validates :name, :presence => true, :uniqueness => { :case_sensitive => false }

serialize :settings

Expand Down

0 comments on commit ad57f99

Please sign in to comment.