def METHOD_NAME(options, isgroup, domain, rid):
	"""Return a dict("field": value) for this domain (string) + rid (int)"""
	if domain:
		idstr = "%s-%u" % (domain, rid)
	else:
		idstr = "%u" % rid
	(typename, mapfunc) = {
	    (1, 1): ("SMB Group",   lambda id: solaris.misc.sid_to_name(id, 0)),
	    (1, 0): ("POSIX Group", lambda id: grp.getgrgid(int(id)).gr_name),
	    (0, 1): ("SMB User",    lambda id: solaris.misc.sid_to_name(id, 1)),
	    (0, 0): ("POSIX User",  lambda id: pwd.getpwuid(int(id)).pw_name)
	}[isgroup, bool(domain)]
	if typename.lower().replace(" ", "") not in options.types:
		return None
	v = dict()
	v["type"] = typename
	# python's getpwuid/getgrgid is confused by ephemeral uids
	if not options.noname and rid < 1<<31:
		try:
			v["name"] = mapfunc(idstr)
		except KeyError:
			pass
	if "name" not in v:
		v["name"] = idstr
		if not domain:
			# it's just a number, so pad it with spaces so
			# that it will sort numerically
			v["name.sort"] = "%20d" % rid
	# fill in default values
	v["used"] = "0"
	v["used.sort"] = 0
	v["quota"] = "none"
	v["quota.sort"] = 0
	return v