Fix: If we add a new module, we et permision on user that activate it.
This commit is contained in:
parent
358301faa7
commit
6c6e98f8bb
@ -846,7 +846,7 @@ class DolibarrModules
|
||||
*/
|
||||
function insert_permissions()
|
||||
{
|
||||
global $conf;
|
||||
global $conf,$user;
|
||||
|
||||
$err=0;
|
||||
|
||||
@ -915,6 +915,15 @@ class DolibarrModules
|
||||
}
|
||||
else dol_syslog("DolibarrModules::insert_permissions record already exists", LOG_INFO);
|
||||
}
|
||||
|
||||
// If we are an admin user, we take permission of new module
|
||||
if ($user->admin)
|
||||
{
|
||||
$user->addrights($r_id);
|
||||
// We reload permissions
|
||||
$user->clearrights();
|
||||
$user->getrights();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user