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

Remove catching the UnknownPermissionError

Klaus Zanders6c690f678ec1
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index eaa815270d8..5ca9eb2b051 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -316,16 +316,12 @@ class ApplicationController < ActionController::Base
# context = @project || @projects
# old_authorized = User.current.allowed_to?(action, context, global:)
- is_authorized = begin
- if global
- User.current.allowed_based_on_permission_context?(action)
- else
- User.current.allowed_based_on_permission_context?(action, project: @project || @projects,
- entity: @work_package || @work_packages)
- end
- rescue Authorization::UnknownPermissionError
- false
- end
+ is_authorized = if global
+ User.current.allowed_based_on_permission_context?(action)
+ else
+ User.current.allowed_based_on_permission_context?(action, project: @project || @projects,
+ entity: @work_package || @work_packages)
+ end
unless is_authorized
if @project&.archived?