--- loncom/interface/lonuserutils.pm 2009/11/04 15:35:56 1.103 +++ loncom/interface/lonuserutils.pm 2009/11/12 15:58:22 1.104 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Utility functions for managing LON-CAPA user accounts # -# $Id: lonuserutils.pm,v 1.103 2009/11/04 15:35:56 raeburn Exp $ +# $Id: lonuserutils.pm,v 1.104 2009/11/12 15:58:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1176,7 +1176,7 @@ sub default_role_selector { my %customroles; my ($options,$coursepick,$cb_jscript); if ($context ne 'author') { - %customroles = &my_custom_roles(); + %customroles = &my_custom_roles($crstype); } my %lt=&Apache::lonlocal::texthash( @@ -1350,10 +1350,14 @@ sub curr_role_permissions { # ======================================================= Existing Custom Roles sub my_custom_roles { + my ($crstype) = @_; my %returnhash=(); my %rolehash=&Apache::lonnet::dump('roles'); - foreach my $key (keys %rolehash) { + foreach my $key (keys(%rolehash)) { if ($key=~/^rolesdef\_(\w+)$/) { + if ($crstype eq 'Community') { + next if ($rolehash{$key} =~ /bre\&S/); + } $returnhash{$1}=$1; } } @@ -3900,7 +3904,7 @@ sub upfile_drop_add { } } my (%curr_rules,%got_rules,%alerts); - my %customroles = &my_custom_roles(); + my %customroles = &my_custom_roles($crstype); my @permitted_roles = &roles_on_upload($context,$setting,$crstype,%customroles); # Get new users list