 CREATE FUNCTION 
	UFD_AUTHORIZATION_FORN(@CD_USU_FORN INT)
RETURNS TABLE
AS RETURN
SELECT	
	DISTINCT
	USUARIO.CD_USU_FORN AS USERNAME,
	CASE USUARIO.MASTER
	WHEN 1 THEN 
		'ROLE_ADMIN'
	ELSE
		'ROLE_USER'
	END AS AUTHORITY
FROM
	GLB_USU_FORN USUARIO
WHERE
	USUARIO.CD_USU_FORN = @CD_USU_FORN
