Skip to content

Commit

Permalink
added star rights to permission check in job->init function
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Harrison committed Aug 23, 2012
1 parent 305542f commit 28e63d1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/MGRAST/lib/JobDB/Job.pm
Expand Up @@ -52,7 +52,12 @@ sub init {

# # check if the user has the right to see this job
unless ($job->public) {
unless ( $job->_master->{_user} && $job->_master->{_user}->has_right(undef, 'view' , 'metagenome', $job->metagenome_id ) ){
unless ($job->_master->{_user}) {
print STDERR "Private job ".$job->metagenome_id." called with no user.\n";
return undef;
}
unless ($job->_master->{_user}->has_right(undef,'view','metagenome',$job->metagenome_id) || $job->_master->{_user}->has_star_right('view','metagenome')) {
print STDERR "User ".$job->_master->{_user}->login." lacks rights for job ".$job->metagenome_id.".\n";
return undef;
}
}
Expand Down

0 comments on commit 28e63d1

Please sign in to comment.