Permission search problem 

In my Redmine installation, I can not assure that the first role of any user in the selected project includes the required permission. I rewrote the permission's search in order to traverse the role's array.
PD: I tried to keep the permission's search as a "one-liner".