Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix roles query

Klaus Zanders92f684520460
diff --git a/app/services/authorization.rb b/app/services/authorization.rb
index 96a4217387f..c6818741fc2 100644
--- a/app/services/authorization.rb
+++ b/app/services/authorization.rb
@@ -42,9 +42,9 @@ module Authorization
# Returns all roles a user has in a certain project, for a specific entity or globally
def roles(user, context = nil)
if context.is_a?(Project)
- Authorization::UserProjectRolesQuery.query(user, project)
+ Authorization::UserProjectRolesQuery.query(user, context)
elsif Member.can_be_member_of?(context)
- Authorization::UserEntityRolesQuery.query(user, entity)
+ Authorization::UserEntityRolesQuery.query(user, context)
else
Authorization::UserGlobalRolesQuery.query(user)
end