| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork2/lib/WeBWorK/Authz.pm,v 1.14 2004/03/15 20:17:35 sh002i Exp $ |
4 | # $CVSHeader: webwork2/lib/WeBWorK/Authz.pm,v 1.15 2004/07/12 22:15:56 sh002i Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
6 | # This program is free software; you can redistribute it and/or modify it under |
| 7 | # the terms of either: (a) the GNU General Public License as published by the |
7 | # the terms of either: (a) the GNU General Public License as published by the |
| 8 | # Free Software Foundation; either version 2, or (at your option) any later |
8 | # Free Software Foundation; either version 2, or (at your option) any later |
| 9 | # version, or (b) the "Artistic License" which comes with this package. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 45 | |
45 | |
| 46 | my $Permission = $db->getPermissionLevel($user); # checked |
46 | my $Permission = $db->getPermissionLevel($user); # checked |
| 47 | return 0 unless defined $Permission; |
47 | return 0 unless defined $Permission; |
| 48 | my $permissionLevel = $Permission->permission(); |
48 | my $permissionLevel = $Permission->permission(); |
| 49 | |
49 | |
|
|
50 | my $permissionLevels = $ce->{permissionLevels}; |
| 50 | if (exists $permissionLevels->{$activity}) { |
51 | if (exists $permissionLevels->{$activity}) { |
| 51 | if (defined $permissionLevels->{$activity}) { |
52 | if (defined $permissionLevels->{$activity}) { |
| 52 | return $permissionLevel >= $permissionLevels->{$activity}; |
53 | return $permissionLevel >= $permissionLevels->{$activity}; |
| 53 | } else { |
54 | } else { |
| 54 | return 0; |
55 | return 0; |