Fixing style errors.
This commit is contained in:
parent
e729d76833
commit
7b3fe948a0
@ -703,7 +703,7 @@ class User extends CommonObject
|
|||||||
$moduleRightsMapping = array(
|
$moduleRightsMapping = array(
|
||||||
'product' => 'produit', // We must check $user->rights->produit...
|
'product' => 'produit', // We must check $user->rights->produit...
|
||||||
);
|
);
|
||||||
|
|
||||||
$rightsPath = $module;
|
$rightsPath = $module;
|
||||||
if (!empty($moduleRightsMapping[$rightsPath])) {
|
if (!empty($moduleRightsMapping[$rightsPath])) {
|
||||||
$rightsPath = $moduleRightsMapping[$rightsPath];
|
$rightsPath = $moduleRightsMapping[$rightsPath];
|
||||||
@ -732,13 +732,13 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($permlevel1 == 'recruitmentcandidature') {
|
if ($permlevel1 == 'recruitmentcandidature') {
|
||||||
$permlevel1 = 'recruitmentjobposition';
|
$permlevel1 = 'recruitmentjobposition';
|
||||||
}
|
}
|
||||||
//var_dump($module.' '.$permlevel1.' '.$permlevel2. ' '. $rightsPath);
|
//var_dump($module.' '.$permlevel1.' '.$permlevel2. ' '. $rightsPath);
|
||||||
//var_dump($this->rights);
|
//var_dump($this->rights);
|
||||||
if (empty($rightsPath) || empty($this->rights) || empty($this->rights->$rightsPath) || empty($permlevel1)) {
|
if (empty($rightsPath) || empty($this->rights) || empty($this->rights->$rightsPath) || empty($permlevel1)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($permlevel2) {
|
if ($permlevel2) {
|
||||||
if (!empty($this->rights->$rightsPath->$permlevel1)) {
|
if (!empty($this->rights->$rightsPath->$permlevel1)) {
|
||||||
if (!empty($this->rights->$rightsPath->$permlevel1->$permlevel2)) {
|
if (!empty($this->rights->$rightsPath->$permlevel1->$permlevel2)) {
|
||||||
|
|||||||
@ -263,11 +263,11 @@ class UserTest extends PHPUnit\Framework\TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* testUserHasRight
|
* testUserHasRight
|
||||||
*
|
*
|
||||||
* @param User $localobject User
|
* @param User $localobject User
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function testUserHasRight()
|
public function testUserHasRight()
|
||||||
{
|
{
|
||||||
global $conf,$user,$langs,$db;
|
global $conf,$user,$langs,$db;
|
||||||
@ -282,17 +282,17 @@ class UserTest extends PHPUnit\Framework\TestCase
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
print __METHOD__." id=". $user->id ."\n";
|
print __METHOD__." id=". $user->id ."\n";
|
||||||
//$this->assertNotEquals($user->date_creation, '');
|
//$this->assertNotEquals($user->date_creation, '');
|
||||||
$user->addrights(0, 'supplier_proposal');
|
$user->addrights(0, 'supplier_proposal');
|
||||||
|
|
||||||
$this->assertEquals($user->hasRight('member', ''), 0);
|
$this->assertEquals($user->hasRight('member', ''), 0);
|
||||||
$this->assertEquals($user->hasRight('member', 'member'), 0);$this->assertEquals($user->hasRight('product', 'member', 'read'), 0);
|
$this->assertEquals($user->hasRight('member', 'member'), 0);$this->assertEquals($user->hasRight('product', 'member', 'read'), 0);
|
||||||
$this->assertEquals($user->hasRight('member', 'member'), 0);$this->assertEquals($user->hasRight('produit', 'member', 'read'), 0);
|
$this->assertEquals($user->hasRight('member', 'member'), 0);$this->assertEquals($user->hasRight('produit', 'member', 'read'), 0);
|
||||||
$user->clearrights();
|
$user->clearrights();
|
||||||
//print __METHOD__. $user->hasRight('module', 'level11');
|
//print __METHOD__. $user->hasRight('module', 'level11');
|
||||||
return $user;
|
return $user;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testUserSetPassword
|
* testUserSetPassword
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user