[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Tue, 02 Sep 2008 02:56:55 -0000
raeburn Mon Sep 1 22:56:55 2008 EDT
Modified files:
/loncom/auth lonroles.pm
Log:
- Do not block CA role access if user has been assigned a CA role, (was occurring if user is also a DC, and author blocked ad hoc access by DCs).
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.204 loncom/auth/lonroles.pm:1.205
--- loncom/auth/lonroles.pm:1.204 Fri Aug 22 13:46:52 2008
+++ loncom/auth/lonroles.pm Mon Sep 1 22:56:52 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.204 2008/08/22 17:46:52 bisitz Exp $
+# $Id: lonroles.pm,v 1.205 2008/09/02 02:56:52 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -149,9 +149,12 @@
# Check if author blocked ca-access
my %blocked=&Apache::lonnet::get('environment',['domcoord.author'],$domain,$user);
if ($blocked{'domcoord.author'} eq 'blocked') {
- delete($env{$envkey});
- $env{'user.error.msg'}=':::1:User '.$user.' in domain '.$domain.' blocked domain coordinator access';
- last;
+ my %roleshash = &Apache::lonnet::get_my_roles($user,$domain);
+ if (!defined($roleshash{$env{'user.name'}.':'.$env{'user.domain'}.':ca'})) {
+ delete($env{$envkey});
+ $env{'user.error.msg'}=':::1:User '.$user.' in domain '.$domain.' blocked domain coordinator access';
+ last;
+ }
}
if ($dcroles{$domain}) {
my ($server_status,$home) = &check_author_homeserver($user,$domain);