.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Sympa::Scenario 3Sympa" .TH Sympa::Scenario 3Sympa "2024-01-07" "6.2.70" "sympa 6.2.70" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Sympa::Scenario \- Authorization scenarios .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Sympa::Scenario; \& \& my $scenario = Sympa::Scenario\->new($list, \*(Aqsend\*(Aq, name => \*(Aqprivate\*(Aq); \& my $result = $scenario\->authz(\*(Aqmd5\*(Aq, {sender => $sender}); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Sympa::Scenario provides feature of scenarios which perform authorization on functions of Sympa software against users and clients. .SS "Methods" .IX Subsection "Methods" .ie n .IP "new ( $that, $function, [ name => $name ], [ dont_reload_scenario => 1 ] )" 4 .el .IP "new ( \f(CW$that\fR, \f(CW$function\fR, [ name => \f(CW$name\fR ], [ dont_reload_scenario => 1 ] )" 4 .IX Item "new ( $that, $function, [ name => $name ], [ dont_reload_scenario => 1 ] )" \&\fIConstructor\fR. Creates a new Sympa::Scenario instance. .Sp Parameters: .RS 4 .ie n .IP "$that" 4 .el .IP "\f(CW$that\fR" 4 .IX Item "$that" Context of scenario, list or domain (note that scenario does not have site context). .ie n .IP "$function" 4 .el .IP "\f(CW$function\fR" 4 .IX Item "$function" Specifies scenario function. .ie n .IP "name => $name" 4 .el .IP "name => \f(CW$name\fR" 4 .IX Item "name => $name" Specifies scenario name. If the name was not given, it is taken from list/domain configuration. See \*(L"Scenarios\*(R" for details. .IP "dont_reload_scenario => 1" 4 .IX Item "dont_reload_scenario => 1" If set, won't check if scenario files were updated. .RE .RS 4 .Sp Returns: .Sp A new Sympa::Scenario instance. .RE .ie n .IP "authz ( $auth_method, \e%context, [ debug => 1] )" 4 .el .IP "authz ( \f(CW$auth_method\fR, \e%context, [ debug => 1] )" 4 .IX Item "authz ( $auth_method, %context, [ debug => 1] )" \&\fIInstance method\fR. Return the action to perform for 1 sender using 1 auth method to perform 1 function. .Sp Parameters: .RS 4 .ie n .IP "$auth_method" 4 .el .IP "\f(CW$auth_method\fR" 4 .IX Item "$auth_method" \&'smtp', 'md5', 'pgp', 'smime' or 'dkim'. Note that `pgp` has not been implemented. .IP "\e%context" 4 .IX Item "%context" A hashref containing information to evaluate scenario (scenario context). .IP "debug => 1" 4 .IX Item "debug => 1" Adds keys in the returned hashref. .RE .RS 4 .Sp Returns: .Sp A hashref containing following items. .IP "{action}" 4 .IX Item "{action}" \&'do_it', 'reject', 'request_auth', \&'owner', 'editor', 'editorkey' or 'listmaster'. .IP "{reason}" 4 .IX Item "{reason}" Defined if {action} is 'reject' and in case \f(CW\*(C`reject(reason=\*(Aq...\*(Aq)\*(C'\fR: Key for template authorization_reject.tt2. .IP "{tt2}" 4 .IX Item "{tt2}" Defined if {action} is 'reject' and in case \f(CW\*(C`reject(tt2=\*(Aq...\*(Aq)\*(C'\fR or \&\f(CW\*(C`reject(\*(Aq...tt2\*(Aq)\*(C'\fR: Mail template name to be sent back to request sender. .IP "{condition}" 4 .IX Item "{condition}" The checked condition (defined if debug is set). .IP "{auth_method}" 4 .IX Item "{auth_method}" The checked auth_method (defined if debug is set). .RE .RS 4 .RE .IP "get_current_title ( )" 4 .IX Item "get_current_title ( )" \&\fIInstance method\fR. Gets the title of the scenarioin the current language context. .IP "is_purely_closed ( )" 4 .IX Item "is_purely_closed ( )" \&\fIInstance method\fR. Returns true value if the scenario obviously returns \*(L"reject\*(R" action. .IP "to_string ( )" 4 .IX Item "to_string ( )" \&\fIInstance method\fR. Returns source text of the scenario. .SS "Functions" .IX Subsection "Functions" .ie n .IP "compile ( $that, $data, [ function => $function ], [ file_path => $path ] )" 4 .el .IP "compile ( \f(CW$that\fR, \f(CW$data\fR, [ function => \f(CW$function\fR ], [ file_path => \f(CW$path\fR ] )" 4 .IX Item "compile ( $that, $data, [ function => $function ], [ file_path => $path ] )" \&\fIFunction\fR. Compiles scenario source and returns results. .Sp Parameters: .RS 4 .ie n .IP "$that" 4 .el .IP "\f(CW$that\fR" 4 .IX Item "$that" Context. Sympa::List instance or Robot. .ie n .IP "$data" 4 .el .IP "\f(CW$data\fR" 4 .IX Item "$data" Source text of scenario. .ie n .IP "function => $function" 4 .el .IP "function => \f(CW$function\fR" 4 .IX Item "function => $function" Name of function. Optional. .ie n .IP "file_path => $path" 4 .el .IP "file_path => \f(CW$path\fR" 4 .IX Item "file_path => $path" Path of scenario file. Optional. .RE .RS 4 .Sp Returns: .Sp Hashref with following items, or \f(CW\*(C`undef\*(C'\fR on failure. .IP "{compiled}" 4 .IX Item "{compiled}" Compiled scenario represented by Perl code. .IP "{sub}" 4 .IX Item "{sub}" Compiled coderef. .IP "{data}" 4 .IX Item "{data}" Source text of the scenario. .IP "{title}" 4 .IX Item "{title}" Hashref representing titles of the scenario. .IP "{rules}" 4 .IX Item "{rules}" Arrayref to texts of rules. .IP "{purely_closed}" 4 .IX Item "{purely_closed}" True if the scenario is purely closed. .IP "{date}" 4 .IX Item "{date}" Keep track of the current time if \f(CW\*(C`file_path\*(C'\fR is given. This is used later to reload scenario files when they changed on disk. .RE .RS 4 .RE .ie n .IP "get_scenarios ( $that, $function )" 4 .el .IP "get_scenarios ( \f(CW$that\fR, \f(CW$function\fR )" 4 .IX Item "get_scenarios ( $that, $function )" \&\fIFunction\fR. Gets all scenarios beloging to context \f(CW$that\fR and function \f(CW$function\fR. .ie n .IP "request_action ( $that, $function, $auth_method, \e%context, [ name => $name ], [ dont_reload_scenario => 1 ], [ debug => 1] )" 4 .el .IP "request_action ( \f(CW$that\fR, \f(CW$function\fR, \f(CW$auth_method\fR, \e%context, [ name => \f(CW$name\fR ], [ dont_reload_scenario => 1 ], [ debug => 1] )" 4 .IX Item "request_action ( $that, $function, $auth_method, %context, [ name => $name ], [ dont_reload_scenario => 1 ], [ debug => 1] )" \&\fIFunction\fR. Obsoleted on Sympa 6.2.42. Use \fBauthz()\fR method instead. .SS "Attributes" .IX Subsection "Attributes" Instance of Sympa::Scenario has these attributes: .IP "{context}" 4 .IX Item "{context}" Context given by \fBnew()\fR. .IP "{function}" 4 .IX Item "{function}" Name of function. .IP "{name}" 4 .IX Item "{name}" Scenario name. .IP "{file_path}" 4 .IX Item "{file_path}" Full path of scenario file. .SS "Scenarios" .IX Subsection "Scenarios" A scenario file is named as \fI\f(CI\*(C`function\*(C'\fI\fR\f(CW\*(C`.\*(C'\fR\fI\f(CI\*(C`name\*(C'\fI\fR, where \fI\f(CI\*(C`function\*(C'\fI\fR is one of predefined function names, and \&\fI\f(CI\*(C`name\*(C'\fI\fR distinguishes policy. .PP If \fBnew()\fR is called without \f(CW\*(C`name\*(C'\fR option, it is taken from configuration parameter of context. Some functions don't have corresponding configuration parameter and \f(CW\*(C`name\*(C'\fR options for them are mandatory. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBsympa_scenario\fR\|(5). .SH "HISTORY" .IX Header "HISTORY" \&\fBauthz()\fR method obsoleting \fBrequest_action()\fR function was introduced on Sympa 6.2.41b. \&\fBcompile()\fR function was added on Sympa 6.2.49b.