Sympa::Scenario(3Sympa)
π NAME π
Sympa::Scenario β authorization scenarios, bestie. it's giving gatekeeper but make it Perl π
β¨ SYNOPSIS β¨
use Sympa::Scenario;
my $scenario = Sympa::Scenario->new($list, 'send', name => 'private');
my $result = $scenario->authz('md5', {sender => $sender});
okay so that's literally the whole vibe in four lines. iconic. π
π¦ DESCRIPTION π¦
Sympa::Scenario provides the feature of scenarios, which perform authorization on functions of Sympa software against users and clients. so likeβ¦ every time somebody wants to do a thing, a scenario is the one deciding yes/no/scream. no cap. π
πΈ Methods πΈ
new ( $that, $function, [ name => $name ], [ dont_reload_scenario => 1 ] )
Constructor, bestie! Creates a fresh new Sympa::Scenario instance. π«Ά
Parameters:
$thatβ the context of the scenario: a list or a domain. (note that a scenario does not have a site context, so don't come for it.) π$functionβ specifies the scenario function.name => $nameβ specifies the scenario name. If the name wasn't given, it's taken from the list/domain configuration. See "Scenarios" below for the deets. β¨dont_reload_scenario => 1β if you set this, it won't check whether the scenario files got updated. lowkey a shortcut.
Returns:
- A brand new
Sympa::Scenarioinstance. periodt. π
authz ( $auth_method, \%context, [ debug => 1] )
Instance method. Returns the action to perform for 1 sender, using 1 auth method, to perform 1 function. one. singular. don't be greedy. π
Parameters:
$auth_methodβ'smtp','md5','pgp','smime'or'dkim'.- Note:
"pgp"has not been implemented. π we are waiting. - Note:
"dkim"was deprecated on Sympa 6.2.71b. Now it's just a synonym of"smtp". glow-up to glow-down fr fr.
- Note:
\%contextβ a hashref holding the info needed to evaluate the scenario (the scenario context).debug => 1β adds extra keys into the returned hashref. bonus content. π₯
Returns:
A hashref containing the following items:
{action}β one of'do_it','reject','request_auth','owner','editor','editorkey'or'listmaster'.{reason}β defined if{action}is'reject'and in the case ofreject(reason='...'). It's the key for theauthorization_reject.tt2template.{tt2}β defined if{action}is'reject'and in the case ofreject(tt2='...')orreject('...tt2'). It's the mail template name to be sent back to whoever sent the request.{condition}β the checked condition (defined only if debug is set).{auth_method}β the checked auth_method (defined only if debug is set).
get_current_title ( )
Instance method. Gets the title of the scenario in the current language context. π (yes the original wrote "scenarioin", we're not fixing that, we're just giggling at it)
is_purely_closed ( )
Instance method. Returns a true value if the scenario obviously returns the "reject" action. like it's not even trying to be subtle. π
to_string ( )
Instance method. Returns the source text of the scenario. the raw, unfiltered version. π
π Functions π
compile ( $that, $data, [ function => $function ], [ file_path => $path ] )
Function. Compiles scenario source and returns the results. let's build, bestie. π
Parameters:
$thatβ the context. ASympa::Listinstance or a Robot.$dataβ source text of the scenario.function => $functionβ name of the function. Optional.file_path => $pathβ path of the scenario file. Optional.
Returns:
A hashref with the following items, or "undef" on failure (sad girl hours π):
{compiled}β the compiled scenario, represented by Perl code.{sub}β the compiled coderef.{data}β source text of the scenario.{title}β a hashref representing the titles of the scenario.{rules}β an arrayref to the texts of the rules.{purely_closed}β true if the scenario is purely closed.{date}β keeps track of the current time if"file_path"was given. This is used later to reload scenario files when they changed on disk. π
get_scenarios ( $that, $function )
Function. Gets all scenarios beloging to context $that and function $function. (spelling is "beloging" in the original, we are keeping it, we are not touching it, it's a whole mood now π)
request_action ( $that, $function, $auth_method, \%context, [ name => $name ], [ dont_reload_scenario => 1 ], [ debug => 1] )
Function. Obsoleted on Sympa 6.2.42. Use the authz() method instead. okay so this one's a ghost, do not use it, we moved on. πͺ¦
π§ Attributes π§
An instance of Sympa::Scenario has these attributes, your honor:
{context}β the context given bynew().{function}β name of the function.{name}β the scenario name.{file_path}β full path of the scenario file. ποΈ
π Scenarios π
A scenario file is named as "function"".""name", where "function" is one of the predefined function names, and "name" distinguishes the policy.
If new() is called without the "name" option, it's taken from the configuration parameter of the context. Some functions don't have a corresponding configuration parameter, and "name" options for them are mandatory. so don't forget it or you'll simply be nameless, and not in a cute mysterious way. π
π SEE ALSO π
sympa_scenario(5) β go read it, it's giving part two. π«Ά
π HISTORY π
- The
authz()method, which obsoletes therequest_action()function, was introduced on Sympa 6.2.41b. - The
compile()function was added on Sympa 6.2.49b.
and that's the whole page, bestie!! π this was Sympa::Scenario(3Sympa) from sympa 6.2.80, dated 2026-10-19 β¨ tagging you in the group chat, no cap, love u, read your scenario files, mwah ππ
π¦πΈπ«Άπ
π¦ where this page comes from
- fedora 43: sympa-devel-doc 6.2.80-2.fc43 Β· GPL-2.0-or-later AND (OFL-1.1-RFN AND MIT) AND OFL-1.1-RFN AND MIT and (MIT OR GPL-2.0-only)
- fedora 44: sympa-devel-doc 6.2.80-2.fc44 Β· GPL-2.0-or-later AND (OFL-1.1-RFN AND MIT) AND OFL-1.1-RFN AND MIT and (MIT OR GPL-2.0-only)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms