Fix: bypass the second test if the first is ok
This commit is contained in:
parent
3684271627
commit
d25687276e
@ -167,7 +167,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
|
|||||||
foreach($feature2 as $subfeature)
|
foreach($feature2 as $subfeature)
|
||||||
{
|
{
|
||||||
if (empty($user->rights->$feature->$subfeature->lire) && empty($user->rights->$feature->$subfeature->read)) $readok=0;
|
if (empty($user->rights->$feature->$subfeature->lire) && empty($user->rights->$feature->$subfeature->read)) $readok=0;
|
||||||
else $readok=1;
|
else { $readok=1; break; } // For bypass the second test if the first is ok
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (! empty($feature) && ($feature!='user' && $feature!='usergroup')) // This is for old permissions
|
else if (! empty($feature) && ($feature!='user' && $feature!='usergroup')) // This is for old permissions
|
||||||
@ -216,7 +216,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
|
|||||||
foreach($feature2 as $subfeature)
|
foreach($feature2 as $subfeature)
|
||||||
{
|
{
|
||||||
if (empty($user->rights->$feature->$subfeature->creer) && empty($user->rights->$feature->$subfeature->write)) $createok=0;
|
if (empty($user->rights->$feature->$subfeature->creer) && empty($user->rights->$feature->$subfeature->write)) $createok=0;
|
||||||
else $createok=1;
|
else { $createok=1; break; } // For bypass the second test if the first is ok
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (! empty($feature)) // This is for old permissions
|
else if (! empty($feature)) // This is for old permissions
|
||||||
@ -280,7 +280,7 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
|
|||||||
foreach($feature2 as $subfeature)
|
foreach($feature2 as $subfeature)
|
||||||
{
|
{
|
||||||
if (empty($user->rights->$feature->$subfeature->supprimer) && empty($user->rights->$feature->$subfeature->delete)) $deleteok=0;
|
if (empty($user->rights->$feature->$subfeature->supprimer) && empty($user->rights->$feature->$subfeature->delete)) $deleteok=0;
|
||||||
else $deleteok=1;
|
else { $deleteok=1; break; } // For bypass the second test if the first is ok
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (! empty($feature)) // This is for old permissions
|
else if (! empty($feature)) // This is for old permissions
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user