def perm_is_defined_on(perm, obj):
 return Permission.objects.filter(codename=perm, content_type=ContentType.objects.get_for_model(obj).pk, object_id=obj.pk, approved=True).exists()

def perm_is_defined_on ( perm , obj ) : return Permission . objects . filter ( codename = perm , content_type = ContentType . objects . get_for_model ( obj ) . pk , object_id = obj . pk , approved = True ) . exists ( )
return whether an object has an authority permission that references it .