##// END OF EJS Templates
Prevent roles loading on each call to User#managed_roles for admins....
Jean-Philippe Lang -
r13946:ba61b13008af
parent child
Show More
@@ -157,6 +157,7 class User < Principal
157 157 @notified_projects_ids_changed = false
158 158 @builtin_role = nil
159 159 @visible_project_ids = nil
160 @managed_roles = nil
160 161 base_reload(*args)
161 162 end
162 163
@@ -569,7 +570,7 class User < Principal
569 570 # Returns the roles that the user is allowed to manage for the given project
570 571 def managed_roles(project)
571 572 if admin?
572 Role.givable.to_a
573 @managed_roles ||= Role.givable.to_a
573 574 else
574 575 membership(project).try(:managed_roles) || []
575 576 end
General Comments 0
You need to be logged in to leave comments. Login now