~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/schema.cc

  • 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:
39
39
    schema_iterator= schema_names.begin();
40
40
  }
41
41
 
 
42
Schema::operator const drizzled::message::schema::shared_ptr()
 
43
{
 
44
  while (schema_iterator != schema_names.end())
 
45
  {
 
46
    identifier::Schema schema_identifier(*schema_iterator);
 
47
 
 
48
    if (not plugin::Authorization::isAuthorized(session.user(), schema_identifier, false))
 
49
    {
 
50
      schema_iterator++;
 
51
      continue;
 
52
    }
 
53
 
 
54
    bool is_schema_parsed= plugin::StorageEngine::getSchemaDefinition(schema_identifier, schema);
 
55
    schema_iterator++;
 
56
 
 
57
    if (is_schema_parsed)
 
58
      return schema;
 
59
  }
 
60
 
 
61
  return message::schema::shared_ptr();
 
62
}
 
63
 
 
64
Schema::operator const drizzled::identifier::Schema*()
 
65
{
 
66
  while (schema_iterator != schema_names.end())
 
67
  {
 
68
    const drizzled::identifier::Schema *_ptr= &(*schema_iterator);
 
69
    schema_iterator++;
 
70
 
 
71
    if (not plugin::Authorization::isAuthorized(session.user(), *_ptr, false))
 
72
      continue;
 
73
 
 
74
    return _ptr;
 
75
  }
 
76
 
 
77
  return NULL;
 
78
}
 
79
 
42
80
} /* namespace generator */
43
81
} /* namespace drizzled */