Parent Directory
|
Revision Log
This commit brings several packages up to date and working. I wish I could be more specific, but it's been a while since I've committed. You'll have to check the CVS diffs for more info. --Dennis
1 package WeBWorK::Authz; 2 3 use WeBWorK::DB::Auth; 4 5 sub new($$$) { 6 my $invocant = shift; 7 my $class = ref($invocant) || $invocant; 8 my $self = {}; 9 ($self->{r}, $self->{courseEnvironment}) = @_; 10 bless $self, $class; 11 return $self; 12 } 13 14 sub hasPermissions { 15 my ($self, $user, $activity) = @_; 16 my $r = $self->{r}; 17 my $courseEnvironment = $self->{courseEnvironment}; 18 my $permission_hash = $courseEnvironment->{permission_hash}; 19 my $auth = WeBWorK::DB::Auth->new($courseEnvironment); 20 21 my $permissionLevel = $auth->getPermissions($user); 22 if ($permissionLevel >= $permission_hash->{$activity}) { 23 return 1; 24 } else {return 0;} 25 } 26 27 1;
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |