Beispiel #1
0
        //---------------------------------------------------------------------------------------------------------------------

        public static void LoadPrivileges(IfyContext context)
        {
            privileges.Clear();
            IDataReader reader = context.GetQueryResult("SELECT t.id, t.identifier, t.name, t.id_type, t.operation, t.enable_log FROM priv AS t ORDER BY t.pos;");

            while (reader.Read())
            {
                int                 id           = context.GetIntegerValue(reader, 0);
                int                 entityTypeId = context.GetIntegerValue(reader, 3);
                EntityType          entityType   = entityTypeId == 0 ? null : EntityType.GetEntityTypeFromId(entityTypeId);
                EntityOperationType operation    = GetOperationType(context.GetValue(reader, 4));

                Privilege privilege = new Privilege(
                    id,
                    context.GetValue(reader, 1),
                    context.GetValue(reader, 2),
                    entityType,
                    operation,
                    context.GetBooleanValue(reader, 5)
                    );
                privileges[id] = privilege;
            }
            reader.Close();
        }