~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/plugin/authorization.h

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
class DRIZZLED_API Authorization : public Plugin
40
40
{
41
 
  Authorization();
42
 
  Authorization(const Authorization &);
43
 
  Authorization& operator=(const Authorization &);
44
41
public:
45
42
  explicit Authorization(std::string name_arg)
46
43
    : Plugin(name_arg, "Authorization")
47
44
  {}
48
 
  virtual ~Authorization() {}
49
45
 
50
46
  /**
51
47
   * Should we restrict the current user's access to this schema?
56
52
   * @returns true if the user cannot access the schema
57
53
   */
58
54
  virtual bool restrictSchema(const drizzled::identifier::User &user_ctx,
59
 
                              identifier::Schema::const_reference schema)= 0;
 
55
                              const identifier::Schema& schema)= 0;
60
56
 
61
57
  /**
62
58
   * Should we restrict the current user's access to this table?
67
63
   *
68
64
   * @returns true if the user cannot access the table
69
65
   */
70
 
  virtual bool restrictTable(drizzled::identifier::User::const_reference user_ctx,
71
 
                             drizzled::identifier::Table::const_reference table);
 
66
  virtual bool restrictTable(const drizzled::identifier::User& user_ctx,
 
67
                             const drizzled::identifier::Table& table);
72
68
 
73
69
  /**
74
70
   * Should we restrict the current user's access to see this process?
83
79
                               const drizzled::identifier::User &session_ctx);
84
80
 
85
81
  /** Server API method for checking schema authorization */
86
 
  static bool isAuthorized(drizzled::identifier::User::const_reference user_ctx,
87
 
                           identifier::Schema::const_reference schema_identifier,
 
82
  static bool isAuthorized(const drizzled::identifier::User& user_ctx,
 
83
                           const identifier::Schema& schema_identifier,
88
84
                           bool send_error= true);
89
85
 
90
86
  /** Server API method for checking table authorization */
91
 
  static bool isAuthorized(drizzled::identifier::User::const_reference user_ctx,
92
 
                           drizzled::identifier::Table::const_reference table_identifier,
 
87
  static bool isAuthorized(const drizzled::identifier::User& user_ctx,
 
88
                           const drizzled::identifier::Table& table_identifier,
93
89
                           bool send_error= true);
94
90
 
95
91
  /** Server API method for checking process authorization */
96
 
  static bool isAuthorized(drizzled::identifier::User::const_reference user_ctx,
 
92
  static bool isAuthorized(const drizzled::identifier::User& user_ctx,
97
93
                           const Session &session,
98
94
                           bool send_error= true);
99
95
 
101
97
   * Server API helper method for applying authorization tests
102
98
   * to a set of schema names (for use in the context of getSchemaNames
103
99
   */
104
 
  static void pruneSchemaNames(drizzled::identifier::User::const_reference user_ctx,
105
 
                               identifier::Schema::vector &set_of_schemas);
 
100
  static void pruneSchemaNames(const drizzled::identifier::User& user_ctx,
 
101
                               identifier::schema::vector &set_of_schemas);
106
102
  
107
103
  /**
108
104
   * Standard plugin system registration hooks
112
108
 
113
109
};
114
110
 
115
 
inline bool Authorization::restrictTable(drizzled::identifier::User::const_reference user_ctx,
116
 
                                         drizzled::identifier::Table::const_reference table)
 
111
inline bool Authorization::restrictTable(const drizzled::identifier::User& user_ctx,
 
112
                                         const drizzled::identifier::Table& table)
117
113
{
118
114
  return restrictSchema(user_ctx, table);
119
115
}