What immediately strikes me is that you're using destName in the UnitIsUnit check. I don't think that'll work unless dest is a group member.
You could try doing UnitisAllowed(destGUID)) instead, and then doing something like this instead:
Code:
local function UnitisAllowed(guid)
for key, val in pairs(addon.CONFIG.units) do
if UnitGUID(val) == guid then return true end
end
return false
end