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