Commit 6bf5831d authored by jplang's avatar jplang

Don't destructively insert builtin_role into roles (#23519).

git-svn-id: https://svn.redmine.org/redmine/trunk@16155 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 7215516c
......@@ -678,9 +678,8 @@ class User < Principal
return true if admin?
# authorize if user has at least one role that has this permission
rls = self.roles.to_a
rls << builtin_role
rls.any? {|role|
roles = self.roles.to_a | [builtin_role]
roles.any? {|role|
role.allowed_to?(action) &&
(block_given? ? yield(role, self) : true)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment