~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/authorization.h

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20
20
 */
21
21
 
22
 
#pragma once
 
22
#ifndef DRIZZLED_PLUGIN_AUTHORIZATION_H
 
23
#define DRIZZLED_PLUGIN_AUTHORIZATION_H
23
24
 
24
 
#include <drizzled/plugin.h>
25
 
#include <drizzled/plugin/plugin.h>
26
 
#include <drizzled/identifier.h>
 
25
#include "drizzled/plugin.h"
 
26
#include "drizzled/plugin/plugin.h"
 
27
#include "drizzled/identifier.h"
27
28
 
28
29
#include <string>
29
30
#include <set>
30
31
 
31
 
#include <drizzled/visibility.h>
 
32
#include "drizzled/visibility.h"
32
33
 
33
34
namespace drizzled
34
35
{
56
57
   * @returns true if the user cannot access the schema
57
58
   */
58
59
  virtual bool restrictSchema(const drizzled::identifier::User &user_ctx,
59
 
                              const identifier::Schema& schema)= 0;
 
60
                              identifier::Schema::const_reference schema)= 0;
60
61
 
61
62
  /**
62
63
   * Should we restrict the current user's access to this table?
67
68
   *
68
69
   * @returns true if the user cannot access the table
69
70
   */
70
 
  virtual bool restrictTable(const drizzled::identifier::User& user_ctx,
71
 
                             const drizzled::identifier::Table& table);
 
71
  virtual bool restrictTable(const drizzled::identifier::User &user_ctx,
 
72
                             identifier::Table &table);
72
73
 
73
74
  /**
74
75
   * Should we restrict the current user's access to see this process?
83
84
                               const drizzled::identifier::User &session_ctx);
84
85
 
85
86
  /** Server API method for checking schema authorization */
86
 
  static bool isAuthorized(const drizzled::identifier::User& user_ctx,
87
 
                           const identifier::Schema& schema_identifier,
 
87
  static bool isAuthorized(drizzled::identifier::User::const_shared_ptr user_ctx,
 
88
                           identifier::Schema::const_reference schema_identifier,
88
89
                           bool send_error= true);
89
90
 
90
91
  /** Server API method for checking table authorization */
91
 
  static bool isAuthorized(const drizzled::identifier::User& user_ctx,
92
 
                           const drizzled::identifier::Table& table_identifier,
93
 
                           bool send_error= true);
94
 
 
95
 
  /** Server API method for checking process authorization */
96
 
  static bool isAuthorized(const drizzled::identifier::User& user_ctx,
97
 
                           const Session &session,
 
92
  static bool isAuthorized(drizzled::identifier::User::const_shared_ptr user_ctx,
 
93
                           identifier::Table &table_identifier,
 
94
                           bool send_error= true);
 
95
 
 
96
  /** Server API method for checking process authorization */
 
97
  static bool isAuthorized(drizzled::identifier::User::const_shared_ptr user_ctx,
 
98
                           const Session *session,
 
99
                           bool send_error= true);
 
100
 
 
101
  /** Server API method for checking process authorization */
 
102
  static bool isAuthorized(drizzled::identifier::User::const_reference user_ctx,
 
103
                           const Session *session,
98
104
                           bool send_error= true);
99
105
 
100
106
  /**
101
107
   * Server API helper method for applying authorization tests
102
108
   * to a set of schema names (for use in the context of getSchemaNames
103
109
   */
104
 
  static void pruneSchemaNames(const drizzled::identifier::User& user_ctx,
105
 
                               identifier::schema::vector &set_of_schemas);
 
110
  static void pruneSchemaNames(drizzled::identifier::User::const_shared_ptr user_ctx,
 
111
                               identifier::Schema::vector &set_of_schemas);
106
112
  
107
113
  /**
108
114
   * Standard plugin system registration hooks
112
118
 
113
119
};
114
120
 
115
 
inline bool Authorization::restrictTable(const drizzled::identifier::User& user_ctx,
116
 
                                         const drizzled::identifier::Table& table)
 
121
inline bool Authorization::restrictTable(const drizzled::identifier::User &user_ctx,
 
122
                                         identifier::Table &table)
117
123
{
118
124
  return restrictSchema(user_ctx, table);
119
125
}
128
134
 
129
135
} /* namespace drizzled */
130
136
 
 
137
#endif /* DRIZZLED_PLUGIN_AUTHORIZATION_H */