~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/schema.cc

  • Committer: Brian Aker
  • Date: 2010-12-17 00:08:06 UTC
  • mfrom: (2002.1.4 clean)
  • Revision ID: brian@tangent.org-20101217000806-fa6kmggjnhsl4q85
Rollup for field encapsulation, monty fix for bzrignore, and Andrew bug
fixes.

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>
24
 
#include <drizzled/session.h>
 
23
#include "drizzled/generator.h"
25
24
 
26
25
using namespace std;
27
26
 
40
39
    schema_iterator= schema_names.begin();
41
40
  }
42
41
 
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
 
 
81
42
} /* namespace generator */
82
43
} /* namespace drizzled */