select
	pr.name,
	pe.type,
	o.name,
	o.type_desc,
	pe.permission_name,
	state_desc
from
	sys.database_principals pr
	join sys.database_permissions pe on (pr.principal_id = pe.grantee_principal_id)
	join sys.objects o on (pe.major_id = o.object_id)
where
	pe.state in ('W','G')
	and o.type = 'U'
order by pr.name,o.name,pe.permission_name
