20
20
#include "config.h"
24
#include "drizzled/plugin/authorization.h"
25
#include "drizzled/security_context.h"
22
#include <drizzled/plugin/authorization.h>
28
26
using namespace drizzled;
34
public plugin::Authorization
38
plugin::Authorization("test authz")
41
/* I told you it was a silly plugin.
42
If the db name is authz_no and the user is authz, then it's blocked
43
If it's anything else, it's approved
45
virtual bool restrictSchema(const SecurityContext &user_ctx,
46
const std::string &db)
48
if (db == "authz_no" and user_ctx.getUser() == "authz")
53
virtual bool restrictProcess(const SecurityContext &user_ctx,
54
const SecurityContext &session_ctx)
56
if (user_ctx.getUser() == session_ctx.getUser())
58
if (user_ctx.getUser() == "authz")
66
static int init(plugin::Context &context)
28
namespace simple_user_policy
31
static int init(module::Context &context)
33
context.add(new Policy);
73
} /* namespace authz */
37
} /* namespace simple_user_policy */
75
DRIZZLE_PLUGIN(authz::init, NULL);
39
DRIZZLE_PLUGIN(simple_user_policy::init, NULL, NULL);