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

Catch excpetion when trying to watch with a permission that does not exist

Klaus Zanders3334bb954f23
diff --git a/lib_static/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/lib_static/plugins/acts_as_watchable/lib/acts_as_watchable.rb
index 949a75abb4d..9e018beb6f0 100644
--- a/lib_static/plugins/acts_as_watchable/lib/acts_as_watchable.rb
+++ b/lib_static/plugins/acts_as_watchable/lib/acts_as_watchable.rb
@@ -98,6 +98,9 @@ module Redmine
def possible_watcher?(user)
user.allowed_in_project?(self.class.acts_as_watchable_permission, project)
+ rescue Authorization::UnknownPermissionError
+ # As not every acts_as_watchable permission is defined, we deal with those here for now
+ false
end
# Returns all users that could potentially be watchers.