@classmethod
    def user_has_role(cls, user, obj):
        return user.has_perms(cls.class_to_permissions[type(obj)], obj)
Check that a user has this role.
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/libs/permissions.py/Role.user_has_role