code: def getContactUIDForUser(self):
          
          mt = getToolByName(self, 'portal_membership')
          user = mt.getAuthenticatedMember()
          user_id = user.getUserName()
          pc = getToolByName(self, 'portal_catalog')
          r = pc(portal_type='Contact',
                 getUsername=user_id)
          if len(r) == 1:
              return r[0].UID
docs: get the UID of the contact associated with the authenticated user