~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/authorization.h

Merge with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include <string>
30
30
#include <set>
31
31
 
 
32
#include "drizzled/visibility.h"
 
33
 
32
34
namespace drizzled
33
35
{
34
36
 
35
37
namespace plugin
36
38
{
37
39
 
38
 
class Authorization : public Plugin
 
40
class DRIZZLED_API Authorization : public Plugin
39
41
{
40
42
  Authorization();
41
43
  Authorization(const Authorization &);
55
57
   * @returns true if the user cannot access the schema
56
58
   */
57
59
  virtual bool restrictSchema(const drizzled::identifier::User &user_ctx,
58
 
                              SchemaIdentifier::const_reference schema)= 0;
 
60
                              identifier::Schema::const_reference schema)= 0;
59
61
 
60
62
  /**
61
63
   * Should we restrict the current user's access to this table?
66
68
   *
67
69
   * @returns true if the user cannot access the table
68
70
   */
69
 
  virtual bool restrictTable(const drizzled::identifier::User &user_ctx,
70
 
                             TableIdentifier &table);
 
71
  virtual bool restrictTable(drizzled::identifier::User::const_reference user_ctx,
 
72
                             drizzled::identifier::Table::const_reference table);
71
73
 
72
74
  /**
73
75
   * Should we restrict the current user's access to see this process?
82
84
                               const drizzled::identifier::User &session_ctx);
83
85
 
84
86
  /** Server API method for checking schema authorization */
85
 
  static bool isAuthorized(drizzled::identifier::User::const_shared_ptr user_ctx,
86
 
                           SchemaIdentifier::const_reference schema_identifier,
 
87
  static bool isAuthorized(drizzled::identifier::User::const_reference user_ctx,
 
88
                           identifier::Schema::const_reference schema_identifier,
87
89
                           bool send_error= true);
88
90
 
89
91
  /** Server API method for checking table authorization */
90
 
  static bool isAuthorized(drizzled::identifier::User::const_shared_ptr user_ctx,
91
 
                           TableIdentifier &table_identifier,
 
92
  static bool isAuthorized(drizzled::identifier::User::const_reference user_ctx,
 
93
                           drizzled::identifier::Table::const_reference table_identifier,
92
94
                           bool send_error= true);
93
95
 
94
96
  /** Server API method for checking process authorization */
95
 
  static bool isAuthorized(drizzled::identifier::User::const_shared_ptr user_ctx,
96
 
                           const Session *session,
 
97
  static bool isAuthorized(drizzled::identifier::User::const_reference user_ctx,
 
98
                           const Session &session,
97
99
                           bool send_error= true);
98
100
 
99
101
  /**
100
102
   * Server API helper method for applying authorization tests
101
103
   * to a set of schema names (for use in the context of getSchemaNames
102
104
   */
103
 
  static void pruneSchemaNames(drizzled::identifier::User::const_shared_ptr user_ctx,
104
 
                               SchemaIdentifier::vector &set_of_schemas);
 
105
  static void pruneSchemaNames(drizzled::identifier::User::const_reference user_ctx,
 
106
                               identifier::Schema::vector &set_of_schemas);
105
107
  
106
108
  /**
107
109
   * Standard plugin system registration hooks
111
113
 
112
114
};
113
115
 
114
 
inline bool Authorization::restrictTable(const drizzled::identifier::User &user_ctx,
115
 
                                         TableIdentifier &table)
 
116
inline bool Authorization::restrictTable(drizzled::identifier::User::const_reference user_ctx,
 
117
                                         drizzled::identifier::Table::const_reference table)
116
118
{
117
119
  return restrictSchema(user_ctx, table);
118
120
}