Skip to content
This repository was archived by the owner on Sep 3, 2018. It is now read-only.

Commit eb77b7a

Browse files
author
pgoiffon
committed
N°1328 Fix CSV import : check if user has rights on imported class
git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@5597 a333f486-631f-4898-b8df-5754b55c2be0
1 parent 85a34aa commit eb77b7a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pages/csvimport.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ function DisplaySynchroBanner(WebPage $oP, $sClass, $iCount)
192192
*/
193193
function ProcessCSVData(WebPage $oPage, $bSimulate = true)
194194
{
195+
$sClassName = utils::ReadParam('class_name', '', false, 'class');
196+
// Class access right check for the import
197+
if (UserRights::IsActionAllowed($sClassName, UR_ACTION_MODIFY) == UR_ALLOWED_NO)
198+
{
199+
throw new CoreException(Dict::S('UI:ActionNotAllowed'));
200+
}
201+
195202
$aResult = array();
196203
$sCSVData = utils::ReadParam('csvdata', '', false, 'raw_data');
197204
$sCSVDataTruncated = utils::ReadParam('csvdata_truncated', '', false, 'raw_data');
@@ -203,7 +210,6 @@ function ProcessCSVData(WebPage $oPage, $bSimulate = true)
203210
{
204211
$iSkippedLines = utils::ReadParam('nb_skipped_lines', '0');
205212
}
206-
$sClassName = utils::ReadParam('class_name', '', false, 'class');
207213
$aFieldsMapping = utils::ReadParam('field', array(), false, 'raw_data');
208214
$aSearchFields = utils::ReadParam('search_field', array(), false, 'field_name');
209215
$iCurrentStep = $bSimulate ? 4 : 5;

0 commit comments

Comments
 (0)