Skip to content

Instantly share code, notes, and snippets.

@parthaa
Created October 27, 2017 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parthaa/fa5ff7118d35c9763c4c2cdcc5cea4df to your computer and use it in GitHub Desktop.
Save parthaa/fa5ff7118d35c9763c4c2cdcc5cea4df to your computer and use it in GitHub Desktop.
Patch for /usr/share/foreman/app/models/role.rb
diff --git a/app/models/role.rb b/app/models/role.rb
index 18d6fa6..43e9cd0 100644
--- a/app/models/role.rb
+++ b/app/models/role.rb
@@ -284,8 +284,9 @@ class Role < ActiveRecord::Base
end
def permission_records(permissions)
- collection = Permission.where(:name => permissions.flatten).all
- raise ::Foreman::PermissionMissingException.new(N_('some permissions were not found')) if collection.size != permissions.size
+ perms = permissions.flatten
+ collection = Permission.where(:name => perms).all
+ raise ::Foreman::PermissionMissingException.new(N_('some permissions were not found')) if collection.size != perms.size
collection
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment