~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/schema.h

  • Committer: Brian Aker
  • Date: 2011-02-12 10:06:03 UTC
  • mfrom: (2154.2.16 drizzle-build)
  • Revision ID: brian@tangent.org-20110212100603-i5ww0s02p8l4a8q7
Merge in solaris tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef DRIZZLED_GENERATOR_SCHEMA_H
22
22
#define DRIZZLED_GENERATOR_SCHEMA_H
23
23
 
24
 
#include <drizzled/session.h>
25
24
#include <drizzled/plugin/authorization.h>
26
25
#include <drizzled/plugin/storage_engine.h>
27
26
 
28
27
namespace drizzled {
 
28
 
 
29
class Session;
 
30
 
29
31
namespace generator {
30
32
 
31
33
class Schema
40
42
 
41
43
  Schema(Session &arg);
42
44
 
43
 
  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
 
      bool is_schema_parsed= plugin::StorageEngine::getSchemaDefinition(schema_identifier, schema);
56
 
      schema_iterator++;
57
 
 
58
 
      if (is_schema_parsed)
59
 
        return schema;
60
 
    }
61
 
 
62
 
    return message::schema::shared_ptr();
63
 
  }
64
 
 
65
 
  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
 
  }
 
45
  operator const drizzled::message::schema::shared_ptr();
 
46
  operator const drizzled::identifier::Schema*();
80
47
};
81
48
 
82
49
} /* namespace generator */