| … | |
… | |
| 22 | ($self->{r}, $self->{courseEnvironment}) = @_; |
22 | ($self->{r}, $self->{courseEnvironment}) = @_; |
| 23 | bless $self, $class; |
23 | bless $self, $class; |
| 24 | return $self; |
24 | return $self; |
| 25 | } |
25 | } |
| 26 | |
26 | |
|
|
27 | # This currently only uses two of it's arguments, but it accepts any number, in |
|
|
28 | # case in the future calculating certain permissions requires more information. |
| 27 | sub hasPermissions { |
29 | sub hasPermissions { |
| 28 | my ($self, $user, $activity) = @_; |
30 | my ($self, $user, $activity) = @_; |
| 29 | my $r = $self->{r}; |
31 | my $r = $self->{r}; |
| 30 | my $courseEnvironment = $self->{courseEnvironment}; |
32 | my $courseEnvironment = $self->{courseEnvironment}; |
| 31 | my $permission_hash = $courseEnvironment->{permission_hash}; |
33 | my $permission_hash = $courseEnvironment->{permission_hash}; |