Public feed #527627

Unnamed

public text v1 · immutable
Raw Edit
·published 2007-06-01 11:38 UTC
rendered paste body
       public List<EvaluateSecurityRight> GeneralSecurityAnalyseWO(int objectType, int objectID, List<int> listRole)
       {
          pixco.frameworktest.AMF_devDb DB = new pixco.frameworktest.AMF_devDb();
           
           EvaluateSecurityRight evaluateSecurityRight = new EvaluateSecurityRight();
           pixco.frameworktest.SecurityRight securityRight = new pixco.frameworktest.SecurityRight();
           pixco.frameworktest.SecurityRuleDataMapper oRuleMapper = new pixco.frameworktest.SecurityRuleDataMapper(DB);
           
           QueryResult query = oRuleMapper.findAll(new Hashtable());

           string strRole = "";
           foreach ( int i in listRole)
           {
               strRole += i.ToString() + ",";
           }
           strRole = strRole.Remove(strRole.Length - 1, 1);
           string str = @"select * from [security].securityright rights, [security].securityrole roles, [security].securityrule rules,[security].SecurityRuleSecurityRight rightLink, [security].SecurityRuleSecurityRole roleLink where rightlink.securityrightid = rights.id and rightlink.securityruleid = rules.id and rolelink.securityroleid = roles.id and rolelink.securityruleid = rules.id and rules.objectType = " + objectType.ToString() + @" and (rules.objectid = " + objectID.ToString() + @" OR rules.objectid = null) and (roles.ID in (" + strRole + "))";


           QueryResult query2 = oRuleMapper.findBySql(str);
           //List<Object> listRule2 = (List<Object>)query2.Result;
           Object o = query2.Result;

           //QueryResult query = oRuleMapper.findBySql(
           List<pixco.frameworktest.SecurityRule> listRule = (List<pixco.frameworktest.SecurityRule>)query2.Result;
           foreach (pixco.frameworktest.SecurityRule oRule in listRule)
           {
              // pixco.frameworktest.SecurityRuleSecurityRole ruleRole = new pixco.frameworktest.SecurityRuleSecurityRole();
               foreach (pixco.frameworktest.SecurityRuleSecurityRole oRole in oRule.relatedSecurityRuleSecurityRole)
               {
               }
           }



   

           return null;
       }