Skip to content

Commit

Permalink
Merge pull request #1214 from jonstout/node-query
Browse files Browse the repository at this point in the history
update permissions on edit_workgroup
  • Loading branch information
jonstout authored Sep 21, 2020
2 parents 40dabb7 + 3103aef commit 6f5aee1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions frontend/webservice/admin/admin.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ use OESS::DB::Workgroup;
use OESS::ACL;
use OESS::Endpoint;
use OESS::Interface;
use OESS::Workgroup;

#use Time::HiRes qw( gettimeofday tv_interval);

Expand Down Expand Up @@ -2529,13 +2530,18 @@ sub gen_topology{
sub edit_workgroup{
my ($method, $args) = @_;

# my ($user, $err) = authorization(admin => 1, read_only => 0);
my ($result, $err) = OESS::DB::User::has_system_access(db => $db2, username => $ENV{'REMOTE_USER'}, role => 'normal');
my $workgroup = new OESS::Workgroup(db => $db2, workgroup_id => $args->{workgroup_id}{value});
if (!defined $workgroup) {
$method->set_error("Workgroup $args->{workgroup_id}{value} not found.");
return;
}

my ($result, $err) = OESS::DB::User::has_system_access(db => $db2, username => $ENV{'REMOTE_USER'}, role => $workgroup->{type});
if (defined $err) {
$method->set_error($err);
return;
}

my $workgroup_id = $args->{'workgroup_id'}{'value'};
my $workgroup_name = $args->{'name'}{'value'};
my $external_id = $args->{'external_id'}{'value'};
Expand Down

0 comments on commit 6f5aee1

Please sign in to comment.