NAME

Disbatch::Roles - define and create MongoDB roles and users for Disbatch

VERSION

version 4.103

SUBROUTINES

new

Parameters: db => $db, plugin_perms => $plugin_perms, additional_perms => $additional_perms, disbatchd => $disbatchd_pw, disbatch_web => $disbatch_web_pw, task_runner => $task_runner_pw, queuebalance => queuebalance, plugin => $plugin_pw

C<db> is a C<MongoDB::Database> object which must be authenticated with an accout having the C<root> role.
C<plugin_perms> is a C<HASH> in the format of C<< { collection_name => array_of_actions, ... } >>, to give the plugin the needed permissions for MongoDB.
C<additional_perms> a C<HASH> in the format of C<< role_name => {collection_name => array_of_actions, ...}, ... } >>, to set additional permissions for included roles.
C<disbatchd>, C<disbatch_web>, C<task_runner>, C<queuebalance>, and C<plugin> are roles and users to create, with their values being their respective passwords.

Dies if invalid parameters.

add_additional_perms($name)

Parameters: name of the role to add additional privileges to.

Adds additional privileges to userroles if additional_perms was passed to new(). See --additional_perms in disbatch-create-users.

Returns nothing.

create_roles_and_users

Parameters: none.

Creates the roles and users for disbatchd, disbatch_web, task_runner, queuebalance, and plugin, after calling add_additional_perms().

Dies if the roles or users already exist, or on any other MongoDB error.

drop_roles_and_users

Parameters: none.

Drops the roles and users for disbatchd, disbatch_web, task_runner, queuebalance, and plugin.

Dies if the roles or users don't exist(???), or on any other MongoDB error.

SEE ALSO

Disbatch

Disbatch::Web

Disbatch::Plugin::Demo

disbatchd

disbatch.pl

task_runner

disbatch-create-users

AUTHORS

Ashley Willis <awillis@synacor.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2016, 2019 by Ashley Willis.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004