drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
regex_policy::Policy Class Reference
Inheritance diagram for regex_policy::Policy:
[legend]
Collaboration diagram for regex_policy::Policy:
[legend]

Public Member Functions

 Policy (const std::string &f_path)
virtual bool restrictSchema (const drizzled::identifier::User &user_ctx, const drizzled::identifier::Schema &schema)
virtual bool restrictProcess (const drizzled::identifier::User &user_ctx, const drizzled::identifier::User &session_ctx)
virtual bool restrictTable (const drizzled::identifier::User &user_ctx, const drizzled::identifier::Table &table)
void setPolicies (PolicyItemList new_table_policies, PolicyItemList new_schema_policies, PolicyItemList new_process_policies)
void clearPolicies ()
std::string & getPolicyFile ()
bool setPolicyFile (std::string &new_policy_file)
std::stringstream & getError ()
Public Member Functions inherited from drizzled::plugin::Authorization
 Authorization (std::string name_arg)
Public Member Functions inherited from drizzled::plugin::Plugin
 Plugin (const std::string &name, const std::string &type_name)
virtual void shutdownPlugin ()
virtual void prime ()
virtual void startup (drizzled::Session &)
void activate ()
void deactivate ()
bool isActive () const
const std::string & getName () const
void setModule (module::Module *module)
const std::string & getTypeName () const
virtual bool removeLast () const
const std::string & getModuleName () const

Private Member Functions

bool restrictObject (const drizzled::identifier::User &user_ctx, const std::string &obj, const PolicyItemList &policies, CheckMap &check_cache)

Private Attributes

std::string sysvar_policy_file
fs::path policy_file
std::stringstream error
PolicyItemList table_policies
PolicyItemList schema_policies
PolicyItemList process_policies
CheckMap table_check_cache
CheckMap schema_check_cache
CheckMap process_check_cache

Additional Inherited Members

Public Types inherited from drizzled::plugin::Plugin
typedef std::pair< const std::string, const std::string > map_key
typedef std::unique_ptr< plugin::Plugin, deleter_fn > owned_ptr
typedef std::map< const map_key, owned_ptr > map
typedef std::vector< Plugin * > vector
Static Public Member Functions inherited from drizzled::plugin::Authorization
static bool isAuthorized (const drizzled::identifier::User &user_ctx, const identifier::Schema &schema_identifier, bool send_error=true)
static bool isAuthorized (const drizzled::identifier::User &user_ctx, const drizzled::identifier::Table &table_identifier, bool send_error=true)
static bool isAuthorized (const drizzled::identifier::User &user_ctx, const Session &session, bool send_error=true)
static void pruneSchemaNames (const drizzled::identifier::User &user_ctx, identifier::schema::vector &set_of_schemas)
static bool addPlugin (plugin::Authorization &auth)
static void removePlugin (plugin::Authorization &auth)

Detailed Description

Definition at line 164 of file regex_policy/policy.h.

Constructor & Destructor Documentation

◆ Policy()

regex_policy::Policy::Policy ( const std::string & f_path)
inline

Definition at line 168 of file regex_policy/policy.h.

◆ ~Policy()

regex_policy::Policy::~Policy ( )

Definition at line 243 of file plugin/regex_policy/module.cc.

Member Function Documentation

◆ clearPolicies()

void regex_policy::Policy::clearPolicies ( )

Definition at line 254 of file plugin/regex_policy/module.cc.

◆ getError()

std::stringstream & regex_policy::Policy::getError ( )
inline

Definition at line 186 of file regex_policy/policy.h.

◆ getPolicyFile()

std::string & regex_policy::Policy::getPolicyFile ( )

Definition at line 208 of file plugin/regex_policy/module.cc.

◆ restrictObject()

bool regex_policy::Policy::restrictObject ( const drizzled::identifier::User & user_ctx,
const std::string & obj,
const PolicyItemList & policies,
CheckMap & check_cache )
private

Definition at line 265 of file plugin/regex_policy/module.cc.

◆ restrictProcess()

bool regex_policy::Policy::restrictProcess ( const drizzled::identifier::User & user_ctx,
const drizzled::identifier::User & session_ctx )
virtual

Should we restrict the current user's access to see this process?

Parameters
Currentsecurity context
Databaseto check against
Tableto check against
Returns
true if the user cannot see the process

Reimplemented from drizzled::plugin::Authorization.

Definition at line 292 of file plugin/regex_policy/module.cc.

◆ restrictSchema()

bool regex_policy::Policy::restrictSchema ( const drizzled::identifier::User & user_ctx,
const drizzled::identifier::Schema & schema )
virtual

Should we restrict the current user's access to this schema?

Parameters
Currentsecurity context
Databaseto check against
Returns
true if the user cannot access the schema

Implements drizzled::plugin::Authorization.

Definition at line 286 of file plugin/regex_policy/module.cc.

◆ restrictTable()

bool regex_policy::Policy::restrictTable ( const drizzled::identifier::User & user_ctx,
const drizzled::identifier::Table & table )
virtual

Should we restrict the current user's access to this table?

Parameters
Currentsecurity context
Databaseto check against
Tableto check against
Returns
true if the user cannot access the table

Reimplemented from drizzled::plugin::Authorization.

Definition at line 298 of file plugin/regex_policy/module.cc.

◆ setPolicies()

void regex_policy::Policy::setPolicies ( PolicyItemList new_table_policies,
PolicyItemList new_schema_policies,
PolicyItemList new_process_policies )

Definition at line 194 of file plugin/regex_policy/module.cc.

◆ setPolicyFile()

bool regex_policy::Policy::setPolicyFile ( std::string & new_policy_file)

Definition at line 213 of file plugin/regex_policy/module.cc.

Member Data Documentation

◆ error

std::stringstream regex_policy::Policy::error
private

Definition at line 194 of file regex_policy/policy.h.

◆ policy_file

fs::path regex_policy::Policy::policy_file
private

Definition at line 193 of file regex_policy/policy.h.

◆ process_check_cache

CheckMap regex_policy::Policy::process_check_cache
private

Definition at line 200 of file regex_policy/policy.h.

◆ process_policies

PolicyItemList regex_policy::Policy::process_policies
private

Definition at line 197 of file regex_policy/policy.h.

◆ schema_check_cache

CheckMap regex_policy::Policy::schema_check_cache
private

Definition at line 199 of file regex_policy/policy.h.

◆ schema_policies

PolicyItemList regex_policy::Policy::schema_policies
private

Definition at line 196 of file regex_policy/policy.h.

◆ sysvar_policy_file

std::string regex_policy::Policy::sysvar_policy_file
private

Definition at line 192 of file regex_policy/policy.h.

◆ table_check_cache

CheckMap regex_policy::Policy::table_check_cache
private

Definition at line 198 of file regex_policy/policy.h.

◆ table_policies

PolicyItemList regex_policy::Policy::table_policies
private

Definition at line 195 of file regex_policy/policy.h.


The documentation for this class was generated from the following files: