[ https://issues.apache.org/jira/browse/TC-535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16133276#comment-16133276 ]
ASF GitHub Bot commented on TC-535: ----------------------------------- Github user mitchell852 commented on a diff in the pull request: https://github.com/apache/incubator-trafficcontrol/pull/831#discussion_r134007130 --- Diff: traffic_ops/app/lib/API/DeliveryService/KeysUrlSig.pm --- @@ -69,14 +86,17 @@ sub copy_url_sig_keys { else { return $self->alert("Delivery Service to copy from '$copy_from_xml_id' does not exist."); } + if (!$tenant_utils->is_ds_resource_accessible($tenants_data, $copy_rs->tenant_id)) { + return $self->forbidden("Forbidden. Source delivery-service tenant is not available to the user."); + } my $copy_config_file = $self->url_sig_config_file_name($copy_from_xml_id); my $helper = new Utils::Helper( { mojo => $self } ); my $url_sig_key_values_json; #verify we can copy keys out if ( $helper->is_valid_delivery_service($copy_ds_id) ) { - if ( $is_admin || $helper->is_delivery_service_assigned($copy_ds_id) ) { + if ( $is_admin || $helper->is_delivery_service_assigned($copy_ds_id) || $tenant_utils->use_tenancy()) { --- End diff -- I don't understand this line. If use_tenancy is 1 then it doesn't matter if you are an admin or you have the ds assigned you simply have to have the right tenant.....right? > DS URL sig key apis needs to have tenancy check in place > -------------------------------------------------------- > > Key: TC-535 > URL: https://issues.apache.org/jira/browse/TC-535 > Project: Traffic Control > Issue Type: Bug > Components: Traffic Ops API > Affects Versions: 2.1.0 > Reporter: Jeremy Mitchell > Assignee: Nir Sopher > Fix For: 2.1.0, 2.2.0 > > > Tenancy was introduced in 2.1, however, by default it is turned off via the > use_tenancy parameter but when activated it is used to limit the scope of > delivery services that a user can act on. > The following APIs needs to check tenancy to ensure users cannot act on ds's > that they don't have access to. > post("/api/$version/deliveryservices/xmlId/:xmlId/urlkeys/generate > post("/api/$version/deliveryservices/xmlId/:xmlId/urlkeys/copyFromXmlId/:copyFromXmlId > get("/api/$version/deliveryservices/xmlId/:xmlId/urlkeys -- This message was sent by Atlassian JIRA (v6.4.14#64029)