Context.Security.IsUserInRole as L (UserName as C, RoleName as C)


Is Login a Member of one Security Group

Is Login a Member of multiple Security Groups




dim cn as sql::Connection

dim args as sql::Arguments

dim rs as sql::ResultSet

cn.open("::name::conn")


dim session.u

if context.security.IsUserInRoles(session.userid,"Administrators") = .f.

       args.set("ulink",session.ulink)


       vsql = "SELECT distinct company,ID FROM vendor WHERE inactive <> 1 AND ID = :ulink ORDER BY company,id"

       else

       vsql = "SELECT distinct company,ID FROM vendor WHERE inactive <> 1 ORDER BY company,id"

end if


cn.execute(vsql,args)

rs = cn.resultset


e.rtc.vendor_lst = rs.tostring(-1,1,.t.,"|")


cn.close()