Пример #1
0
        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);
 }
Пример #3
0
        public static bool UserCanSelectFromPlan(this IQuery query, IQueryPlanNode queryPlan)
        {
            var selectedTables = queryPlan.DiscoverTableNames();

            return(selectedTables.All(query.UserCanSelectFromTable));
        }
Пример #4
0
        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);
            }
            */
        }
Пример #5
0
 /// <inheritdoc/>
 public virtual IList <ObjectName> DiscoverTableNames(IList <ObjectName> list)
 {
     return(Right.DiscoverTableNames(Left.DiscoverTableNames(list)));
 }