Add comment to guide developers

The exception is already intended to nudge devs towards defining a permission.
However, first time developers might not realize in which way permissions are defined,
even though they can see the location where the exception was raised.

This comment is intended to help them find their way.
This commit is contained in:
Jan Sandbrink
2026-05-21 09:21:25 +02:00
parent 9c139c4a5f
commit 08fab3ac55
+2
View File
@@ -85,6 +85,8 @@ module Authorization
if perms.blank?
if !OpenProject::AccessControl.disabled_permission?(action)
# See https://www.openproject.org/docs/development/concepts/permissions/#definition-of-permissions
# if you are wondering where to define permissions
Rails.logger.debug { "Used permission \"#{action}\" that is not defined. It will never return true." }
raise UnknownPermissionError.new(action) if raise_on_unknown
end