SELECT --P.PORTAL_NAME,
--P.PORTAL_REFTYPE,
--P.PORTAL_OBJNAME,
A.*,
P.PORTAL_LABEL,
R.PATH,
P.PORTAL_URLTEXT
FROM
(
SELECT DISTINCT
U.ROLEUSER ,
C.MENUNAME ,
C.PNLGRPNAME,
C.MARKET
FROM PSROLEUSER U
JOIN PSROLECLASS A
ON A.ROLENAME = U.ROLENAME
JOIN PSAUTHITEM B
ON B.CLASSID = A.CLASSID
JOIN PSMENUITEM C
ON C.MENUNAME = B.MENUNAME
AND C.BARNAME = B.BARNAME
AND C.ITEMNAME = B.BARITEMNAME
) A
JOIN PSPRSMDEFN P
ON P.PORTAL_URI_SEG1 = A.MENUNAME
AND P.PORTAL_URI_SEG2 = A.PNLGRPNAME
AND P.PORTAL_URI_SEG3 = A.MARKET
JOIN
(
SELECT CONNECT_BY_ROOT(PORTAL_NAME) ROOT_NAME,
CONNECT_BY_ROOT(PORTAL_REFTYPE) ROOT_REFTYPE,
CONNECT_BY_ROOT(PORTAL_OBJNAME) ROOT_OBJNAME,
PORTAL_OBJNAME,
RTRIM(REVERSE(SYS_CONNECT_BY_PATH(REVERSE(PORTAL_LABEL),' > ')),' > ') PATH
FROM PSPRSMDEFN
CONNECT
BY NOCYCLE PRIOR PORTAL_NAME = PORTAL_NAME
AND PRIOR PORTAL_PRNTOBJNAME = PORTAL_OBJNAME
) R
ON R.ROOT_NAME = P.PORTAL_NAME
AND R.ROOT_REFTYPE = P.PORTAL_REFTYPE
AND R.ROOT_OBJNAME = P.PORTAL_OBJNAME
WHERE A.ROLEUSER = 'username'
AND P.PORTAL_NAME = 'EMPLOYEE'
AND P.PORTAL_REFTYPE = 'C'
AND R.PORTAL_OBJNAME = 'PORTAL_ROOT_OBJECT'
AND A.PNLGRPNAME = 'component'
Thanks to Rob for this one.
No comments:
Post a Comment