private void CheckUserSelectPermissions(IQueryContext context, IQueryPlanNode plan) { // Discover the list of TableName objects this command touches, IList <ObjectName> touchedTables = plan.DiscoverTableNames(new List <ObjectName>()); IDatabase dbase = context.Connection.Database; /* * TODO: * // Check that the user is allowed to select from these tables. * foreach (ObjectName table in touchedTables) { * if (!dbase.CanUserSelectFromTableObject(context, table, null)) * throw new UserAccessException("User not permitted to select from table: " + table); * } */ }
public static bool UserCanSelectFromPlan(this IQueryContext context, IQueryPlanNode queryPlan) { var selectedTables = queryPlan.DiscoverTableNames(); return selectedTables.All(context.UserCanSelectFromTable); }
public static bool UserCanSelectFromPlan(this IQuery query, IQueryPlanNode queryPlan) { var selectedTables = queryPlan.DiscoverTableNames(); return(selectedTables.All(query.UserCanSelectFromTable)); }
private void CheckUserSelectPermissions(IQueryContext context, IQueryPlanNode plan) { // Discover the list of TableName objects this command touches, IList<ObjectName> touchedTables = plan.DiscoverTableNames(new List<ObjectName>()); IDatabase dbase = context.Connection.Database; /* TODO: // Check that the user is allowed to select from these tables. foreach (ObjectName table in touchedTables) { if (!dbase.CanUserSelectFromTableObject(context, table, null)) throw new UserAccessException("User not permitted to select from table: " + table); } */ }
/// <inheritdoc/> public virtual IList <ObjectName> DiscoverTableNames(IList <ObjectName> list) { return(Right.DiscoverTableNames(Left.DiscoverTableNames(list))); }