@classmethod
    def get_for_instance(cls, instance):
        try:
            permissions = cls._registry[type(instance)]
        except KeyError:
            try:
                permissions = cls._registry[cls._proxies[type(instance)]]
            except __HOLE__:
                permissions = ()

        pks = [permission.stored_permission.pk for permission in permissions]
        return StoredPermission.objects.filter(pk__in=pks)
dataset/ETHPy150Open mayan-edms/mayan-edms/mayan/apps/acls/classes.py/ModelPermission.get_for_instance