From 92528c88d224a1b06a7b348a1ed68716c3cf7ac1 Mon Sep 17 00:00:00 2001 From: Tobias Paczian Date: Tue, 8 Jan 2013 02:54:40 -0600 Subject: [PATCH 1/2] fixed star rights handling --- src/MGRAST/lib/resources2/abundanceprofile.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MGRAST/lib/resources2/abundanceprofile.pm b/src/MGRAST/lib/resources2/abundanceprofile.pm index fcbc96be..0e287bdd 100644 --- a/src/MGRAST/lib/resources2/abundanceprofile.pm +++ b/src/MGRAST/lib/resources2/abundanceprofile.pm @@ -114,7 +114,7 @@ sub instance { $job = $job->[0]; # check rights - unless ($job->{public} || exists($self->rights->{$id})) { + unless ($job->{public} || exists($self->rights->{$id}) || ($self->user && $self->user->has_right(undef, 'view', 'metagenome', '*'))) { $self->return_data( {"ERROR" => "insufficient permissions to view this data"}, 401 ); } From 34dd84e9c8576a0ca4a22d08700af1f01ee7935b Mon Sep 17 00:00:00 2001 From: Tobias Paczian Date: Tue, 8 Jan 2013 03:38:54 -0600 Subject: [PATCH 2/2] fixed star rights usage --- src/MGRAST/lib/resources2/metagenome.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/MGRAST/lib/resources2/metagenome.pm b/src/MGRAST/lib/resources2/metagenome.pm index 6d15d6b9..48880a32 100644 --- a/src/MGRAST/lib/resources2/metagenome.pm +++ b/src/MGRAST/lib/resources2/metagenome.pm @@ -23,12 +23,12 @@ sub new { "library" => [ 'reference library', 'reference to the related library object' ], "sample" => [ 'reference sample', 'reference to the related sample object' ], "project" => [ 'reference project', 'reference to the project object' ], - "metadata" => [ 'hash', 'key value pairs describing metadata' ], - "created" => [ 'date', 'time the object was first created' ], + "metadata" => [ 'hash', 'key value pairs describing metadata' ], + "created" => [ 'date', 'time the object was first created' ], "version" => [ 'integer', 'version of the object' ], - "url" => [ 'uri', 'resource location of this object instance' ], - "status" => ['cv', [['public', 'object is public'], - ['private', 'object is private']]], + "url" => [ 'uri', 'resource location of this object instance' ], + "status" => [ 'cv', [ ['public', 'object is public'], + ['private', 'object is private'] ] ], "sequence_type" => [ 'string', 'sequencing type' ] }; return $self; @@ -119,7 +119,7 @@ sub instance { $job = $job->[0]; # check rights - unless ($job->{public} || exists($self->rights->{$id})) { + unless ($job->{public} || exists($self->rights->{$id}) || ($self->user && $self->user->has_right(undef, 'view', 'metagenome', '*'))) { $self->return_data( {"ERROR" => "insufficient permissions to view this data"}, 401 ); }