There is
from guardian.shortcuts import get_objects_for_user
But what about
from guardian.shortcuts import get_users_for_object
Thanks.
This is my workaround. This is Model method. You can encapsulate it in mixin.
def get_users_with_perm(self, permission):
'''
Returns list of users(worn:not QuerySet) with specific permission for this object
:param permission: permission string
'''
anyperm = get_users_with_perms(self, attach_perms=True)
result = []
for user, perms in anyperm.iteritems():
if permission in perms: result.append(user)
return result