mattupstate/flask-security — pull request #111 by joshpurvis (2013-04-13 19:34:10+00:00)
Title: Changed has_role to accept strings with mongoengine. Fixes #110

This is the cleanest way I could come up with to fix issue #110. I feel putting `RoleMixin` before `db.Document` in the inheritance chain, as Matt suggested in the issue, isn't exactly the most transparent way to resolve this.

The only other way I could think of would be to use `Permission(RoleNeed(role)).can()` in the case of a string, but I believe that would mess with the context. It definitely causes the current `has_role` tests to fail.

Also, I slipped in a small DRY change for the `RoleMixin` class.