Optimizations on sp_Tag_permissions_get and functions to convert DN/SID/ID