Permission Lists Assigned to a User

 SQL that I find useful in many occasions. It will return a list of permissions that are assigned to a specific user.

SELECT d.oprid, d.oprdefndesc, c.roleuser, a.rolename, a.classid,
b.classdefndesc
FROM psroleclass a, psclassdefn b, psroleuser c, psoprdefn d
WHERE a.classid = b.classid
AND c.rolename = a.rolename
AND d.oprid = c.roleuser
AND d.oprid = :userid
GROUP BY d.oprid,
d.oprdefndesc,
c.roleuser,
a.rolename,
a.classid,
b.classdefndesc;
-- at run time, substitute :userid with the user id you want the SQL to run against.

posted @ 2013-10-24 14:41  Bryan chen  阅读(167)  评论(0编辑  收藏  举报