Closed ospalope closed 2 years ago
I cannot recreate the issue (in debug mode or not).
I'm having the same (or at least a very similar) problem. Right now, if I login with my LDAP account having the dynamic Self Service profile with non-recursive "Root" entity and an additional dynamic profile with recursive permissions on a sub entity, I can't open the entity selection dialog in both profiles, even after switching between both profiles.
Only after leaving the initial front page by going to some sub page (e.g. Assets -> Computers) AND switching profiles at least once, I'm able to open the entity selection dialog again.
If it helps, in the html code, the entity selection dropdown is a <span>xxx</span>
in non-working case and <div><a>xxx</a><div>initially hidden entity selection dialog</div></div>
in the working case.
Edit: Going to a sub page and reloading it once (or going to another sub page) is enough to make it work. So no need to switch profiles (guess that was just doing the "reload"), at least for me.
Did some testing with my installation and I think this is caused by the session variable "glpi_multientitiesmode".
On an initial login (on my setup) this var is unset (?) and "/templates/layout/parts/profile_selector.html.twig" seems to decide, that there are no other entities to switch to and thus creates a static menu entry. Just switching between profiles didn't change that for me.
Looks like this var is set with Session::isMultiEntitiesMode(), I added some debug output there and obviously this function isn't called by login or switching profiles alone. But it is by going to some other page than the front page, in my case triggered by /src/Search.php (as the call stack shows). This first call to Session::isMultiEntitiesMode() then sets the session var "glpi_multientitiesmode" and the 2nd call (by reloading or going to some other page) finally makes "profile_selector.html.twig" see my other entities and allow the selection dialog.
@sl077 Does the issue go away if you make the following replacement in /templates/layout/parts/profile_selector.html.twig
?
- {% if session('glpi_multientitiesmode') == 0 %}
+{% if not is_multi_entities_mode() %}
@cconard96 Yes, that makes it work for me.
Code of Conduct
Is there an existing issue for this?
Version
10.0.1
Bug description
When a user who is not a superuser tries to change the entity, it is not possible, the CTRL ALT E access does not work either. You need to switch to super user and back to the profile you were using and sometimes it gets enabled. I found the same problem in version 10.0 and now in 10.0.1 image with problem: after change to super user and come back to last profile: The user have all permission to access to several entities
Relevant log output
No response
Page URL
No response
Steps To reproduce
Your GLPI setup information
Informaciones sobre instalaciones y configuraciones de sistema
Server
GLPI constants
Libraries
SQL replicas
Notifications
Plugins list
Anything else?
No response