~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/schema.cc

  • Committer: Brian Aker
  • Date: 2011-02-22 06:12:02 UTC
  • mfrom: (2190.1.6 drizzle-build)
  • Revision ID: brian@tangent.org-20110222061202-k03czxykqy4x9hjs
List update, header fixes, multiple symbols, and David deletes some code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include "config.h"
 
21
#include <config.h>
22
22
 
23
 
#include "drizzled/generator.h"
 
23
#include <drizzled/generator.h>
 
24
#include <drizzled/session.h>
24
25
 
25
26
using namespace std;
26
27
 
39
40
    schema_iterator= schema_names.begin();
40
41
  }
41
42
 
 
43
Schema::operator const drizzled::message::schema::shared_ptr()
 
44
{
 
45
  while (schema_iterator != schema_names.end())
 
46
  {
 
47
    identifier::Schema schema_identifier(*schema_iterator);
 
48
 
 
49
    if (not plugin::Authorization::isAuthorized(*session.user(), schema_identifier, false))
 
50
    {
 
51
      schema_iterator++;
 
52
      continue;
 
53
    }
 
54
 
 
55
    schema= plugin::StorageEngine::getSchemaDefinition(schema_identifier);
 
56
    schema_iterator++;
 
57
 
 
58
    if (schema)
 
59
      return schema;
 
60
  }
 
61
 
 
62
  return message::schema::shared_ptr();
 
63
}
 
64
 
 
65
Schema::operator const drizzled::identifier::Schema*()
 
66
{
 
67
  while (schema_iterator != schema_names.end())
 
68
  {
 
69
    const drizzled::identifier::Schema *_ptr= &(*schema_iterator);
 
70
    schema_iterator++;
 
71
 
 
72
    if (not plugin::Authorization::isAuthorized(*session.user(), *_ptr, false))
 
73
      continue;
 
74
 
 
75
    return _ptr;
 
76
  }
 
77
 
 
78
  return NULL;
 
79
}
 
80
 
42
81
} /* namespace generator */
43
82
} /* namespace drizzled */