Scroll to navigation

Sympa::Scenario(3Sympa) sympa 6.2.58 Sympa::Scenario(3Sympa)


Sympa::Scenario - Authorization scenarios


  use Sympa::Scenario;
  my $scenario = Sympa::Scenario->new($list, 'send', name => 'private');
  my $result = $scenario->authz('md5', {sender => $sender});


Sympa::Scenario provides feature of scenarios which perform authorization on functions of Sympa software against users and clients.


Constructor. Creates a new Sympa::Scenario instance.


Context of scenario, list or domain (note that scenario does not have site context).
Specifies scenario function.
Specifies scenario name. If the name was not given, it is taken from list/domain configuration. See "Scenarios" for details.
If set, won't check if scenario files were updated.


A new Sympa::Scenario instance.

Instance method. Return the action to perform for 1 sender using 1 auth method to perform 1 function.


'smtp', 'md5', 'pgp', 'smime' or 'dkim'. Note that `pgp` has not been implemented.
A hashref containing information to evaluate scenario (scenario context).
Adds keys in the returned hashref.


A hashref containing following items.

'do_it', 'reject', 'request_auth', 'owner', 'editor', 'editorkey' or 'listmaster'.
Defined if {action} is 'reject' and in case "reject(reason='...')": Key for template authorization_reject.tt2.
Defined if {action} is 'reject' and in case "reject(tt2='...')" or "reject('...tt2')": Mail template name to be sent back to request sender.
The checked condition (defined if debug is set).
The checked auth_method (defined if debug is set).
Instance method. Gets the title of the scenarioin the current language context.
Instance method. Returns true value if the scenario obviously returns "reject" action.
Instance method. Returns source text of the scenario.


Function. Compiles scenario source and returns results.


Context. Sympa::List instance or Robot.
Source text of scenario.
Name of function. Optional.
Path of scenario file. Optional.


Hashref with following items, or "undef" on failure.

Compiled scenario represented by Perl code.
Compiled coderef.
Source text of the scenario.
Hashref representing titles of the scenario.
Arrayref to texts of rules.
True if the scenario is purely closed.
Keep track of the current time if "file_path" is given. This is used later to reload scenario files when they changed on disk.
Function. Gets all scenarios beloging to context $that and function $function.
Function. Obsoleted on Sympa 6.2.42. Use authz() method instead.


Instance of Sympa::Scenario has these attributes:

Context given by new().
Name of function.
Scenario name.
Full path of scenario file.


A scenario file is named as "function"".""name", where "function" is one of predefined function names, and "name" distinguishes policy.

If new() is called without "name" option, it is taken from configuration parameter of context. Some functions don't have corresponding configuration parameter and "name" options for them are mandatory.




authz() method obsoleting request_action() function was introduced on Sympa 6.2.41b. compile() function was added on Sympa 6.2.49b.

2020-12-30 6.2.58