@@ -678,9 +678,8 class User < Principal | |||
|
678 | 678 | return true if admin? |
|
679 | 679 | |
|
680 | 680 | # authorize if user has at least one role that has this permission |
|
681 | rls = self.roles.to_a | |
|
682 | rls << builtin_role | |
|
683 | rls.any? {|role| | |
|
681 | roles = self.roles.to_a | [builtin_role] | |
|
682 | roles.any? {|role| | |
|
684 | 683 | role.allowed_to?(action) && |
|
685 | 684 | (block_given? ? yield(role, self) : true) |
|
686 | 685 | } |
General Comments 0
You need to be logged in to leave comments.
Login now