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

« back to all changes in this revision

Viewing changes to plugin/simple_user_policy/module.cc

  • 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:
20
20
#include <config.h>
21
21
 
22
22
#include <drizzled/plugin/authorization.h>
 
23
#include <drizzled/module/option_map.h>
 
24
#include <boost/program_options.hpp>
 
25
 
 
26
namespace po= boost::program_options;
23
27
 
24
28
#include "policy.h"
25
29
 
28
32
namespace simple_user_policy
29
33
{
30
34
 
 
35
std::string remap_dot_to;
 
36
 
31
37
static int init(module::Context &context)
32
38
{
33
39
  context.add(new Policy);
34
40
  return 0;
35
41
}
36
42
 
 
43
static void init_options(drizzled::module::option_context &context)
 
44
{
 
45
  context("remap-dot-to",
 
46
    po::value<std::string>(&remap_dot_to)->default_value("."),
 
47
    N_("Remap '.' to another character/string when controlling access to a schema. Useful for usernames that have a '.' in them. If a '.' is remapped to an underscore, you don't have to quote the schema name."));
 
48
}
 
49
 
37
50
} /* namespace simple_user_policy */
38
51
 
39
 
DRIZZLE_PLUGIN(simple_user_policy::init, NULL, NULL);
 
52
DRIZZLE_DECLARE_PLUGIN
 
53
{
 
54
  DRIZZLE_VERSION_ID,
 
55
  "simple_user_policy",
 
56
  "1.1",
 
57
  "Monty Taylor",
 
58
  N_("Authorization matching username to schema object name"),
 
59
  PLUGIN_LICENSE_GPL,
 
60
  simple_user_policy::init,
 
61
  NULL,
 
62
  simple_user_policy::init_options
 
63
}
 
64
DRIZZLE_DECLARE_PLUGIN_END;