--- loncom/interface/lonuserutils.pm 2009/08/28 22:47:07 1.98 +++ loncom/interface/lonuserutils.pm 2009/09/05 01:13:02 1.99 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.98 2009/08/28 22:47:07 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.99 2009/09/05 01:13:02 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -4846,14 +4846,18 @@ sub roles_by_context { my ($context,$custom) = @_; my @allroles; if ($context eq 'course') { - @allroles = ('st','ad','ta','ep','in','cc'); + @allroles = ('st'); + if ($env{'request.role'} =~ m{^dc\./}) { + push(@allroles,'ad'); + } + push(@allroles,('ta','ep','in','cc')); if ($custom) { push(@allroles,'cr'); } } elsif ($context eq 'author') { @allroles = ('ca','aa'); } elsif ($context eq 'domain') { - @allroles = ('li','dg','sc','au','dc'); + @allroles = ('li','ad','dg','sc','au','dc'); } return @allroles; }