/// <summary> /// Get all the resources against a specific role id /// </summary> /// <param name="pRoleId"></param> /// <returns></returns> public List <RBACD.DatalayerDef.sRoleResourceMap> GetMappedResources(string pRoleId) { List <RBACD.DatalayerDef.sRoleResourceMap> sResourceList = new List <RBACD.DatalayerDef.sRoleResourceMap>(); DataSet ds = new DataSet(); string sql = string.Empty; try { sql = "Select SecurityRightID from securityrightassign where securityGroupID='" + pRoleId + "'"; OdbcConnection con = (OdbcConnection)this.DbConnection; OdbcDataAdapter adp = new OdbcDataAdapter(sql, con); adp.Fill(ds); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { RBACD.DatalayerDef.sRoleResourceMap map = new RBACD.DatalayerDef.sRoleResourceMap(); map.ResourceId = ds.Tables[0].Rows[i][0].ToString(); map.RoleId = pRoleId; sResourceList.Add(map); } return(sResourceList); } catch { return(sResourceList); } }
/// <summary> /// Get all the resources against a specific role id /// </summary> /// <param name="pRoleId"></param> /// <returns></returns> public List<RBACD.DatalayerDef.sRoleResourceMap> GetMappedResources(string pRoleId) { List<RBACD.DatalayerDef.sRoleResourceMap> sResourceList = new List<RBACD.DatalayerDef.sRoleResourceMap>(); DataSet ds = new DataSet(); string sql = string.Empty; try { sql = "Select SecurityRightID from securityrightassign where securityGroupID='"+pRoleId+"'"; OdbcConnection con = (OdbcConnection)this.DbConnection; OdbcDataAdapter adp = new OdbcDataAdapter(sql, con); adp.Fill(ds); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { RBACD.DatalayerDef.sRoleResourceMap map = new RBACD.DatalayerDef.sRoleResourceMap(); map.ResourceId = ds.Tables[0].Rows[i][0].ToString(); map.RoleId = pRoleId; sResourceList.Add(map); } return sResourceList; } catch { return sResourceList; } }