~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/authorization.cc

  • Committer: Mark Atwood
  • Date: 2011-08-12 04:08:33 UTC
  • mfrom: (2385.2.17 refactor5)
  • Revision ID: me@mark.atwood.name-20110812040833-u6j85nc6ahuc0dtz
mergeĀ lp:~olafvdspek/drizzle/refactor5

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
  public std::unary_function<plugin::Authorization *, bool>
60
60
{
61
61
  const identifier::User &user_ctx;
62
 
  identifier::Schema::const_reference schema;
 
62
  const identifier::Schema& schema;
63
63
 
64
64
public:
65
65
  RestrictDbFunctor(const identifier::User &user_ctx_arg,
66
 
                    identifier::Schema::const_reference schema_arg) :
 
66
                    const identifier::Schema& schema_arg) :
67
67
    std::unary_function<plugin::Authorization *, bool>(),
68
68
    user_ctx(user_ctx_arg),
69
69
    schema(schema_arg)
78
78
class RestrictTableFunctor :
79
79
  public std::unary_function<plugin::Authorization *, bool>
80
80
{
81
 
  identifier::User::const_reference user_ctx;
82
 
  identifier::Table::const_reference table;
 
81
  const identifier::User& user_ctx;
 
82
  const identifier::Table& table;
83
83
public:
84
 
  RestrictTableFunctor(identifier::User::const_reference user_ctx_arg,
85
 
                       identifier::Table::const_reference table_arg) :
 
84
  RestrictTableFunctor(const identifier::User& user_ctx_arg,
 
85
                       const identifier::Table& table_arg) :
86
86
    std::unary_function<plugin::Authorization *, bool>(),
87
87
    user_ctx(user_ctx_arg),
88
88
    table(table_arg)
116
116
class PruneSchemaFunctor :
117
117
  public std::unary_function<identifier::Schema&, bool>
118
118
{
119
 
  drizzled::identifier::User::const_reference user_ctx;
 
119
  const drizzled::identifier::User& user_ctx;
120
120
public:
121
 
  PruneSchemaFunctor(drizzled::identifier::User::const_reference user_ctx_arg) :
 
121
  PruneSchemaFunctor(const drizzled::identifier::User& user_ctx_arg) :
122
122
    std::unary_function<identifier::Schema&, bool>(),
123
123
    user_ctx(user_ctx_arg)
124
124
  { }
131
131
 
132
132
} /* namespace */
133
133
 
134
 
bool plugin::Authorization::isAuthorized(identifier::User::const_reference user_ctx,
135
 
                                         identifier::Schema::const_reference schema_identifier,
 
134
bool plugin::Authorization::isAuthorized(const identifier::User& user_ctx,
 
135
                                         const identifier::Schema& schema_identifier,
136
136
                                         bool send_error)
137
137
{
138
138
  /* If we never loaded any authorization plugins, just return true */
162
162
  return true;
163
163
}
164
164
 
165
 
bool plugin::Authorization::isAuthorized(drizzled::identifier::User::const_reference user_ctx,
166
 
                                         identifier::Table::const_reference table_identifier,
 
165
bool plugin::Authorization::isAuthorized(const drizzled::identifier::User& user_ctx,
 
166
                                         const identifier::Table& table_identifier,
167
167
                                         bool send_error)
168
168
{
169
169
  /* If we never loaded any authorization plugins, just return true */
192
192
  return true;
193
193
}
194
194
 
195
 
bool plugin::Authorization::isAuthorized(drizzled::identifier::User::const_reference user_ctx,
196
 
                                         Session::const_reference session,
 
195
bool plugin::Authorization::isAuthorized(const drizzled::identifier::User& user_ctx,
 
196
                                         const Session& session,
197
197
                                         bool send_error)
198
198
{
199
199
  /* If we never loaded any authorization plugins, just return true */
202
202
  
203
203
  // To make sure we hold the user structure we need to have a shred_ptr so
204
204
  // that we increase the count on the object.
205
 
  drizzled::identifier::User::const_shared_ptr session_ctx= session.user();
 
205
  drizzled::identifier::user::ptr session_ctx= session.user();
206
206
 
207
207
 
208
208
  /* Use find_if instead of foreach so that we can collect return codes */
229
229
  return true;
230
230
}
231
231
 
232
 
void plugin::Authorization::pruneSchemaNames(drizzled::identifier::User::const_reference user_ctx,
233
 
                                             identifier::Schema::vector &set_of_schemas)
 
232
void plugin::Authorization::pruneSchemaNames(const drizzled::identifier::User& user_ctx,
 
233
                                             identifier::schema::vector &set_of_schemas)
234
234
{
235
235
  /* If we never loaded any authorization plugins, just return true */
236
236
  if (authorization_plugins.empty())