--- loncom/interface/loncreateuser.pm 2012/06/01 11:39:24 1.361 +++ loncom/interface/loncreateuser.pm 2012/08/14 15:45:06 1.362 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.361 2012/06/01 11:39:24 raeburn Exp $ +# $Id: loncreateuser.pm,v 1.362 2012/08/14 15:45:06 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -233,6 +233,7 @@ sub build_tools_display { 'official' => 'Can request creation of official courses', 'unofficial' => 'Can request creation of unofficial courses', 'community' => 'Can request creation of communities', + 'requestauthor' => 'Can request author space', ); if ($context eq 'requestcourses') { %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, @@ -247,6 +248,16 @@ sub build_tools_display { %domconfig = &Apache::lonnet::get_dom('configuration',['requestcourses'],$ccdomain); $isadv = &Apache::lonnet::is_advanced_user($ccuname,$ccdomain); + } elsif ($context eq 'requestauthor') { + %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, + 'requestauthor'); + @usertools = ('requestauthor'); + @options =('norequest','approval','automatic'); + %reqtitles = &requestauthor_titles(); + %reqdisplay = &requestauthor_display(); + $colspan = ' colspan="2"'; + %domconfig = + &Apache::lonnet::get_dom('configuration',['requestauthor'],$ccdomain); } else { %userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, 'tools.aboutme','tools.portfolio','tools.blog', @@ -261,7 +272,12 @@ sub build_tools_display { $curr_access = &Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef, $context); - if ($userenv{$context.'.'.$item} ne '') { + if ($context eq 'requestauthor') { + if ($userenv{$context} ne '') { + $cust_on = ' checked="checked" '; + $cust_off = ''; + } + } elsif ($userenv{$context.'.'.$item} ne '') { $cust_on = ' checked="checked" '; $cust_off = ''; } @@ -271,6 +287,12 @@ sub build_tools_display { } else { $custom_access = &mt('Currently from custom setting.'); } + } elsif ($context eq 'requestauthor') { + if ($userenv{$context} eq '') { + $custom_access = &mt('Currently from default setting.'); + } else { + $custom_access = &mt('Currently from custom setting.'); + } } else { if ($userenv{$context.'.'.$item} eq '') { $custom_access = @@ -292,15 +314,27 @@ sub build_tools_display { ' '.$lt{$item}.''."\n". ' '."\n". &Apache::loncommon::start_data_table_row()."\n"; - if ($context eq 'requestcourses') { + if (($context eq 'requestcourses') || ($context eq 'requestauthor')) { my ($curroption,$currlimit); - if ($userenv{$context.'.'.$item} ne '') { - $curroption = $userenv{$context.'.'.$item}; + my $envkey = $context.'.'.$item; + if ($context eq 'requestauthor') { + $envkey = $context; + } + if ($userenv{$envkey} ne '') { + $curroption = $userenv{$envkey}; } else { my (@inststatuses); - $curroption = - &Apache::loncoursequeueadmin::get_processtype($ccuname,$ccdomain,$isadv,$ccdomain, - $item,\@inststatuses,\%domconfig); + if ($context eq 'requestcourses') { + $curroption = + &Apache::loncoursequeueadmin::get_processtype('course',$ccuname,$ccdomain, + $isadv,$ccdomain,$item, + \@inststatuses,\%domconfig); + } else { + $curroption = + &Apache::loncoursequeueadmin::get_processtype('requestauthor',$ccuname,$ccdomain, + $isadv,$ccdomain,undef, + \@inststatuses,\%domconfig); + } } if (!$curroption) { $curroption = 'norequest'; @@ -338,28 +372,36 @@ sub build_tools_display { $checked = ' checked="checked"'; } } + my $name = 'crsreq_'.$item; + if ($context eq 'requestauthor') { + $name = $item; + } $custdisp .= ' '; if ($option eq 'autolimit') { - $custdisp .= '
'. $reqtitles{'unlimited'}; - } else { - $custdisp .= ''; - } - $custdisp .= ''; + } else { + $custdisp .= ''; + } + $custdisp .= ''; } $custdisp .= ''; $custradio = ''.&mt('Custom setting').'
'.$custdisp; } else { $currdisp = ($curr_access?&mt('Yes'):&mt('No')); + my $name = $context.'_'.$item; + if ($context eq 'requestauthor') { + $name = $context; + } $custdisp = ' '; $custradio = (' 'x2).'--'.$lt{'cusa'}.': '.$custdisp. ''; @@ -455,6 +497,17 @@ sub coursereq_externaluser { return $output; } +sub domainrole_req { + my ($ccuname,$ccdomain) = @_; + return '

'. + &mt('User Can Request Assignment of Domain Roles?'). + '

'."\n". + &Apache::loncommon::start_data_table(). + &build_tools_display($ccuname,$ccdomain, + 'requestauthor'). + &Apache::loncommon::end_data_table(); +} + sub courserequest_titles { my %titles = &Apache::lonlocal::texthash ( official => 'Official', @@ -478,6 +531,80 @@ sub courserequest_display { return %titles; } +sub requestauthor_titles { + my %titles = &Apache::lonlocal::texthash ( + norequest => 'Not allowed', + approval => 'Approval by Dom. Coord.', + automatic => 'Automatic approval', + ); + return %titles; + +} + +sub requestauthor_display { + my %titles = &Apache::lonlocal::texthash ( + approval => 'Yes, need approval', + automatic => 'Yes, automatic approval', + norequest => 'No', + ); + return %titles; +} + +sub curr_requestauthor { + my ($uname,$udom,$isadv,$inststatuses,$domconfig) = @_; + return unless ((ref($inststatuses) eq 'ARRAY') && (ref($domconfig) eq 'HASH')); + if ($uname eq '' || $udom eq '') { + $uname = $env{'user.name'}; + $udom = $env{'user.domain'}; + $isadv = $env{'user.adv'}; + } + my (%userenv,%settings,$val); + my @options = ('automatic','approval'); + %userenv = + &Apache::lonnet::userenvironment($udom,$uname,'requestauthor','inststatus'); + if ($userenv{'requestauthor'}) { + $val = $userenv{'requestauthor'}; + @{$inststatuses} = ('_custom_'); + } else { + my %alltasks; + if (ref($domconfig->{'requestauthor'}) eq 'HASH') { + %settings = %{$domconfig->{'requestauthor'}}; + if (($isadv) && ($settings{'_LC_adv'} ne '')) { + $val = $settings{'_LC_adv'}; + @{$inststatuses} = ('_LC_adv_'); + } else { + if ($userenv{'inststatus'} ne '') { + @{$inststatuses} = split(',',$userenv{'inststatus'}); + } else { + @{$inststatuses} = ('default'); + } + foreach my $status (@{$inststatuses}) { + if (exists($settings{$status})) { + my $value = $settings{$status}; + next unless ($value); + unless (exists($alltasks{$value})) { + if (ref($alltasks{$value}) eq 'ARRAY') { + unless(grep(/^\Q$status\E$/,@{$alltasks{$value}})) { + push(@{$alltasks{$value}},$status); + } + } else { + @{$alltasks{$value}} = ($status); + } + } + } + } + foreach my $option (@options) { + if ($alltasks{$option}) { + $val = $option; + last; + } + } + } + } + } + return $val; +} + # =================================================================== Phase one sub print_username_entry_form { @@ -939,7 +1066,7 @@ sub print_user_modification_page { &Apache::lonnet::inst_userrules($ccdomain,'username'); $usertype = &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules, - \%curr_rules,\%got_rules); + \%curr_rules,\%got_rules); my $cancreate = &Apache::lonuserutils::can_create_user($ccdomain,$context, $usertype); @@ -951,7 +1078,9 @@ sub print_user_modification_page { ); my $response; if ($env{'form.origform'} eq 'crtusername') { - $response = ''.&mt('No match found for the username [_1] in LON-CAPA domain: [_2]',''.$ccuname.'',$ccdomain). + $response = ''. + &mt('No match found for the username [_1] in LON-CAPA domain: [_2]', + ''.$ccuname.'',$ccdomain). '
'; } $response .= '

' @@ -1068,12 +1197,15 @@ ENDFORMINFO } } if ($newuser) { - my $portfolioform; + my ($portfolioform,$domroleform); if ((&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) || (&Apache::lonnet::allowed('mut',$env{'request.role.domain'}))) { # Current user has quota or user tools modification privileges $portfolioform = '
'.&portfolio_quota($ccuname,$ccdomain); } + if (&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) { + $domroleform = '
'.&domainrole_req($ccuname,$ccdomain); + } &initialize_authen_forms($ccdomain,$formname); my %lt=&Apache::lonlocal::texthash( 'cnu' => 'Create New User', @@ -1119,7 +1251,8 @@ $lt{'hs'}: $home_server_pick $r->print($home_server_pick); } if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) { - $r->print('

'.&mt('User Can Request Creation of Courses/Communities in this Domain?').'

'. + $r->print('

'. + &mt('User Can Request Creation of Courses/Communities in this Domain?').'

'. &Apache::loncommon::start_data_table(). &build_tools_display($ccuname,$ccdomain, 'requestcourses'). @@ -1183,7 +1316,7 @@ ENDAUTH } else { $r->print(&Apache::lonuserutils::set_login($ccdomain,$authformkrb,$authformint,$authformloc)); } - $r->print($portfolioform); + $r->print($portfolioform.$domroleform); if ($env{'form.action'} eq 'singlestudent') { $r->print(&date_sections_select($context,$newuser,$formname, $permission)); @@ -1217,10 +1350,10 @@ ENDCHANGEUSER $inst_results{$ccuname.':'.$ccdomain}); $r->print($personal_table); if ($showforceid) { - $r->print(&Apache::lonuserutils::forceid_change($context)); + $r->print(''.&Apache::lonuserutils::forceid_change($context).'
'); } if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) { - $r->print('

'.&mt('User Can Request Creation of Courses/Communities in this Domain?').'

'. + $r->print('

'.&mt('User Can Request Creation of Courses/Communities in this Domain?').'

'. &Apache::loncommon::start_data_table()); if ($env{'request.role.domain'} eq $ccdomain) { $r->print(&build_tools_display($ccuname,$ccdomain,'requestcourses')); @@ -1231,12 +1364,19 @@ ENDCHANGEUSER $r->print(&Apache::loncommon::end_data_table()); } $r->print(''); - my $user_auth_text = &user_authentication($ccuname,$ccdomain,$formname); - my ($user_quota_text,$user_tools_text,$user_reqcrs_text); + my @order = ('auth','quota','tools','requestauthor'); + my %user_text; + my ($isadv,$isauthor) = + &Apache::lonnet::is_advanced_user($ccuname,$ccdomain); + if ((!$isauthor) && + (&Apache::lonnet::allowed('cau',$env{'request.role.domain'}))) { + $user_text{'requestauthor'} = &domainrole_req($ccuname,$ccdomain); + } + $user_text{'auth'} = &user_authentication($ccuname,$ccdomain,$formname); if ((&Apache::lonnet::allowed('mpq',$ccdomain)) || (&Apache::lonnet::allowed('mut',$ccdomain))) { # Current user has quota modification privileges - $user_quota_text = &portfolio_quota($ccuname,$ccdomain); + $user_text{'quota'} = &portfolio_quota($ccuname,$ccdomain); } if (!&Apache::lonnet::allowed('mpq',$ccdomain)) { if (&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) { @@ -1248,7 +1388,7 @@ ENDCHANGEUSER 'youd' => "You do not have privileges to modify the portfolio quota for this user.", 'ichr' => "If a change is required, contact a domain coordinator for the domain", ); - $user_quota_text = <$lt{'dska'} $lt{'youd'} $lt{'ichr'}: $ccdomain ENDNOPORTPRIV @@ -1261,43 +1401,31 @@ ENDNOPORTPRIV 'yodo' => "You do not have privileges to modify Portfolio, Blog, WebDAV, or Personal Information Page settings for this user.", 'ifch' => "If a change is required, contact a domain coordinator for the domain", ); - $user_tools_text = <$lt{'utav'} $lt{'yodo'} $lt{'ifch'}: $ccdomain ENDNOTOOLSPRIV } } - if ($user_auth_text ne '') { - $r->print('
'.$user_auth_text); - if ($user_quota_text ne '') { - $r->print($user_quota_text); - } - if ($user_tools_text ne '') { - $r->print($user_tools_text); - } - if ($env{'form.action'} eq 'singlestudent') { - $r->print(&date_sections_select($context,$newuser,$formname)); - } - } elsif ($user_quota_text ne '') { - $r->print('
'.$user_quota_text); - if ($user_tools_text ne '') { - $r->print($user_tools_text); - } - if ($env{'form.action'} eq 'singlestudent') { - $r->print(&date_sections_select($context,$newuser,$formname)); - } - } elsif ($user_tools_text ne '') { - $r->print('
'.$user_tools_text); - if ($env{'form.action'} eq 'singlestudent') { - $r->print(&date_sections_select($context,$newuser,$formname)); - } - } else { - if ($env{'form.action'} eq 'singlestudent') { - $r->print('
'. - &date_sections_select($context,$newuser,$formname)); + my $gotdiv = 0; + foreach my $item (@order) { + if ($user_text{$item} ne '') { + unless ($gotdiv) { + $r->print('
'); + $gotdiv = 1; + } + $r->print('
'.$user_text{$item}); } } - $r->print('
'); + if ($env{'form.action'} eq 'singlestudent') { + unless ($gotdiv) { + $r->print('
'); + } + $r->print(&date_sections_select($context,$newuser,$formname)); + } + if ($gotdiv) { + $r->print('
'); + } if ($env{'form.action'} ne 'singlestudent') { &display_existing_roles($r,$ccuname,$ccdomain,\%inccourses,$context, $roledom,$crstype); @@ -2316,6 +2444,7 @@ sub update_user_data { my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id'); my @usertools = ('aboutme','blog','webdav','portfolio'); my @requestcourses = ('official','unofficial','community'); + my @requestauthor = ('requestauthor'); my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($env{'form.ccdomain'}); my %canmodify_status = @@ -2412,6 +2541,12 @@ sub update_user_data { \%changeHash,'requestcourses'); } } + if ($env{'form.customrequestauthor'} == 1) { + $newcustom{'requestauthor'} = $env{'form.requestauthor'}; + $changed{'requestauthor'} = &tool_admin('requestauthor', + $newcustom{'requestauthor'}, + \%changeHash,'requestauthor'); + } } if ($canmodify_status{'inststatus'}) { if (exists($env{'form.inststatus'})) { @@ -2470,7 +2605,8 @@ sub update_user_data { 'tools.blog','tools.webdav','tools.portfolio', 'requestcourses.official','requestcourses.unofficial', 'requestcourses.community','reqcrsotherdom.official', - 'reqcrsotherdom.unofficial','reqcrsotherdom.community'], + 'reqcrsotherdom.unofficial','reqcrsotherdom.community', + 'requestauthor'], $env{'form.ccdomain'},$env{'form.ccuname'}); my ($tmp) = keys(%userenv); if ($tmp =~ /^(con_lost|error)/i) { @@ -2598,7 +2734,7 @@ sub update_user_data { $olddefquota,$oldsettingstatus,$newdefquota,$newsettingstatus); @disporder = ('inststatus'); if ($env{'request.role.domain'} eq $env{'form.ccdomain'}) { - push(@disporder,'requestcourses'); + push(@disporder,'requestcourses','requestauthor'); } else { push(@disporder,'reqcrsotherdom'); } @@ -2622,6 +2758,9 @@ sub update_user_data { if (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'})) { $canshow{'inststatus'} = 1; } + if (&Apache::lonnet::allowed('cau',$env{'form.ccdomain'})) { + $canshow{'requestauthor'} = 1; + } my (%changeHash,%changed); if ($oldinststatus eq '') { $oldsettings{'inststatus'} = $othertitle; @@ -2711,6 +2850,7 @@ sub update_user_data { if ($env{'form.ccdomain'} eq $env{'request.role.domain'}) { &tool_changes('requestcourses',\@requestcourses,\%oldsettings,\%oldsettingstext, \%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext); + &tool_changes('requestauthor',\@requestauthor,\%oldsettings,\%oldsettingstext,\%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext); } else { &tool_changes('reqcrsotherdom',\@requestcourses,\%oldsettings,\%oldsettingstext, \%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext); @@ -2738,13 +2878,22 @@ sub update_user_data { || ($key eq 'community')) { $newenvhash{'environment.requestcourses.'.$key} = $changeHash{'requestcourses.'.$key}; - if ($changeHash{'requestcourses.'.$key} ne '') { + if ($changeHash{'requestcourses.'.$key}) { $newenvhash{'environment.canrequest.'.$key} = 1; } else { $newenvhash{'environment.canrequest.'.$key} = &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'}, $key,'reload','requestcourses'); } + } elsif ($key eq 'requestauthor') { + $newenvhash{'environment.'.$key} = $changeHash{$key}; + if ($changeHash{$key}) { + $newenvhash{'environment.canrequest.author'} = 1; + } else { + $newenvhash{'environment.canrequest.author'} = + &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'}, + $key,'reload','requestauthor'); + } } elsif ($key ne 'quota') { $newenvhash{'environment.tools.'.$key} = $changeHash{'tools.'.$key}; @@ -2786,7 +2935,7 @@ sub update_user_data { ((keys(%changed) > 0) && $chgresult eq 'ok')) { # Tell the user we changed the name &display_userinfo($r,1,\@disporder,\%canshow,\@requestcourses, - \@usertools,\%userenv,\%changed,\%namechanged, + \@usertools,\@requestauthor,\%userenv,\%changed,\%namechanged, \%oldsettings, \%oldsettingstext,\%newsettings, \%newsettingstext); if ($env{'form.cid'} ne $userenv{'id'}) { @@ -2819,7 +2968,7 @@ sub update_user_data { # or ability to request creation of courses, # but we can still tell them what the name and quota and availabilities are &display_userinfo($r,undef,\@disporder,\%canshow,\@requestcourses, - \@usertools,\%userenv,\%changed,\%namechanged,\%oldsettings, + \@usertools,\@requestauthor,\%userenv,\%changed,\%namechanged,\%oldsettings, \%oldsettingstext,\%newsettings,\%newsettingstext); } if (@mod_disallowed) { @@ -2896,12 +3045,13 @@ sub update_user_data { } sub display_userinfo { - my ($r,$changed,$order,$canshow,$requestcourses,$usertools,$userenv, - $changedhash,$namechangedhash,$oldsetting,$oldsettingtext, + my ($r,$changed,$order,$canshow,$requestcourses,$usertools,$requestauthor, + $userenv,$changedhash,$namechangedhash,$oldsetting,$oldsettingtext, $newsetting,$newsettingtext) = @_; return unless (ref($order) eq 'ARRAY' && ref($canshow) eq 'HASH' && ref($requestcourses) eq 'ARRAY' && + ref($requestauthor) eq 'ARRAY' && ref($usertools) eq 'ARRAY' && ref($userenv) eq 'HASH' && ref($changedhash) eq 'HASH' && @@ -2926,6 +3076,7 @@ sub display_userinfo { 'official' => 'Can Request Official Courses', 'unofficial' => 'Can Request Unofficial Courses', 'community' => 'Can Request Communities', + 'requestauthor' => 'Can Request Author Role', 'inststatus' => "Affiliation", 'prvs' => 'Previous Value:', 'chto' => 'Changed To:' @@ -3121,25 +3272,29 @@ sub tool_changes { return; } foreach my $tool (@{$usertools}) { - my $newval; + my ($newval,$envkey); + $envkey = $context.'.'.$tool; if ($context eq 'requestcourses') { $newval = $env{'form.crsreq_'.$tool}; if ($newval eq 'autolimit') { $newval .= '='.$env{'form.crsreq_'.$tool.'_limit'}; } + } elsif ($context eq 'requestauthor') { + $newval = $env{'form.'.$context}; + $envkey = $context; } else { $newval = $env{'form.'.$context.'_'.$tool}; } - if ($userenv->{$context.'.'.$tool} ne '') { + if ($userenv->{$envkey} ne '') { $oldaccess->{$tool} = &mt('custom'); - if ($userenv->{$context.'.'.$tool}) { + if ($userenv->{$envkey}) { $oldaccesstext->{$tool} = &mt("availability set to 'on'"); } else { $oldaccesstext->{$tool} = &mt("availability set to 'off'"); } - $changeHash->{$context.'.'.$tool} = $userenv->{$context.'.'.$tool}; + $changeHash->{$envkey} = $userenv->{$envkey}; if ($env{'form.custom'.$tool} == 1) { - if ($newval ne $userenv->{$context.'.'.$tool}) { + if ($newval ne $userenv->{$envkey}) { $changed->{$tool} = &tool_admin($tool,$newval,$changeHash, $context); if ($changed->{$tool}) { @@ -3583,6 +3738,10 @@ sub tool_admin { if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) { $canchange = 1; } + } elsif ($context eq 'requestauthor') { + if (&Apache::lonnet::allowed('cau',$env{'request.role.domain'})) { + $canchange = 1; + } } elsif (&Apache::lonnet::allowed('mut',$env{'form.ccdomain'})) { # Current user has quota modification privileges $canchange = 1; @@ -3591,7 +3750,11 @@ sub tool_admin { if ($canchange) { if (ref($changeHash) eq 'HASH') { $toolchanged = 1; - $changeHash->{$context.'.'.$tool} = $settool; + if ($tool eq 'requestauthor') { + $changeHash->{$context} = $settool; + } else { + $changeHash->{$context.'.'.$tool} = $settool; + } } } return $toolchanged; @@ -4160,6 +4323,32 @@ sub handler { } else { &custom_role_editor($r,$brcrum); } + } elsif (($env{'form.action'} eq 'processauthorreq') && + ($permission->{'cusr'}) && + (&Apache::lonnet::allowed('cau',$env{'request.role.domain'}))) { + push(@{$brcrum}, + {href => '/adm/createuser?action=processauthorreq', + text => 'Authoring space requests', + help => 'Domain_Role_Approvals'}); + $bread_crumbs_component = 'Authoring requests'; + if ($env{'form.state'} eq 'done') { + push(@{$brcrum}, + {href => '/adm/createuser?action=authorreqqueue', + text => 'Result', + help => 'Domain_Role_Approvals'}); + $bread_crumbs_component = 'Authoring request result'; + } + $args = { bread_crumbs => $brcrum, + bread_crumbs_component => $bread_crumbs_component}; + $r->print(&header(undef,$args)); + if (!exists($env{'form.state'})) { + $r->print(&Apache::loncoursequeueadmin::display_queued_requests('requestauthor', + $env{'request.role.domain'})); + } elsif ($env{'form.state'} eq 'done') { + $r->print('

'.&mt('Authoring request processing').'

'."\n"); + $r->print(&Apache::loncoursequeueadmin::update_request_queue('requestauthor', + $env{'request.role.domain'})); + } } elsif (($env{'form.action'} eq 'listusers') && ($permission->{'view'} || $permission->{'cusr'})) { if ($env{'form.phase'} eq 'bulkchange') { @@ -4462,6 +4651,14 @@ sub print_main_menu { permission => $permission->{'custom'}, linktitle => 'Configure a custom role.', }, + { + linktext => 'Authoring Space Requests', + icon => 'selfenrl-queue.png', + #help => 'Domain_Role_Approvals', + url => '/adm/createuser?action=processauthorreq', + permission => $permission->{'cusr'}, + linktitle => 'Approve or reject author role requests', + }, ); }elsif ($context eq 'course'){