Skip to content

Instantly share code, notes, and snippets.

@parthaa
Created Oct 27, 2017
Embed
What would you like to do?
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