22
22
#ifndef DRIZZLED_PLUGIN_AUTHORIZATION_H
23
23
#define DRIZZLED_PLUGIN_AUTHORIZATION_H
25
#include <drizzled/plugin.h>
26
#include <drizzled/plugin/plugin.h>
27
#include <drizzled/identifier.h>
25
#include "drizzled/plugin.h"
26
#include "drizzled/plugin/plugin.h"
27
#include "drizzled/identifier.h"
32
#include <drizzled/visibility.h>
40
class DRIZZLED_API Authorization : public Plugin
38
class Authorization : public Plugin
43
41
Authorization(const Authorization &);
69
67
* @returns true if the user cannot access the table
71
virtual bool restrictTable(drizzled::identifier::User::const_reference user_ctx,
72
drizzled::identifier::Table::const_reference table);
69
virtual bool restrictTable(const drizzled::identifier::User &user_ctx,
70
identifier::Table &table);
75
73
* Should we restrict the current user's access to see this process?
84
82
const drizzled::identifier::User &session_ctx);
86
84
/** Server API method for checking schema authorization */
87
static bool isAuthorized(drizzled::identifier::User::const_reference user_ctx,
85
static bool isAuthorized(drizzled::identifier::User::const_shared_ptr user_ctx,
88
86
identifier::Schema::const_reference schema_identifier,
89
87
bool send_error= true);
91
89
/** Server API method for checking table authorization */
92
static bool isAuthorized(drizzled::identifier::User::const_reference user_ctx,
93
drizzled::identifier::Table::const_reference table_identifier,
94
bool send_error= true);
96
/** Server API method for checking process authorization */
97
static bool isAuthorized(drizzled::identifier::User::const_reference user_ctx,
98
const Session &session,
90
static bool isAuthorized(drizzled::identifier::User::const_shared_ptr user_ctx,
91
identifier::Table &table_identifier,
92
bool send_error= true);
94
/** Server API method for checking process authorization */
95
static bool isAuthorized(drizzled::identifier::User::const_shared_ptr user_ctx,
96
const Session *session,
97
bool send_error= true);
99
/** Server API method for checking process authorization */
100
static bool isAuthorized(drizzled::identifier::User::const_reference user_ctx,
101
const Session *session,
99
102
bool send_error= true);
102
105
* Server API helper method for applying authorization tests
103
106
* to a set of schema names (for use in the context of getSchemaNames
105
static void pruneSchemaNames(drizzled::identifier::User::const_reference user_ctx,
108
static void pruneSchemaNames(drizzled::identifier::User::const_shared_ptr user_ctx,
106
109
identifier::Schema::vector &set_of_schemas);
116
inline bool Authorization::restrictTable(drizzled::identifier::User::const_reference user_ctx,
117
drizzled::identifier::Table::const_reference table)
119
inline bool Authorization::restrictTable(const drizzled::identifier::User &user_ctx,
120
identifier::Table &table)
119
122
return restrictSchema(user_ctx, table);