Skip to content

Commit

Permalink
Close security hole where non torqueadmins could upload data files.
Browse files Browse the repository at this point in the history
We want api users to only be able to query, unless they are admins.
  • Loading branch information
Frank Duncan committed Apr 14, 2020
1 parent 52f064f commit b3afba9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public function __construct($main, $action) {
}

public function execute() {
parent::checkUserRightsAny(["torquedataconnect-admin"]);
# We use phpcurl here because it's really straightforward, and
# research (stackoverflow) didn't produce a compelling native php method.
$attachment = $this->getParameter("attachment");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public function __construct($main, $action) {
}

public function execute() {
parent::checkUserRightsAny(["torquedataconnect-admin"]);
# We use phpcurl here because it's really straightforward, and
# research (stackoverflow) didn't produce a compelling native php method.
$file = $this->getParameter("data_file");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public function __construct($main, $action) {
}

public function execute() {
parent::checkUserRightsAny(["torquedataconnect-admin"]);
# We use phpcurl here because it's really straightforward, and
# research (stackoverflow) didn't produce a compelling native php method.
$json = $this->getParameter("json");
Expand Down

0 comments on commit b3afba9

Please sign in to comment.