You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2021-09-29 01:39:43

aziz
Member
Registered: 2021-03-30
Posts: 109

ticket actors (if User can't acces users list )

Hello everyone,

I'm working on an app where i need to show the information of a ticket, but my I issue here that I need to show (Requester, Watcher, Assigned to) names when using this
URL : “serveurGLPI/apirest.php/ticket/ticket_id "to get a ticket information I get the Ids of actors, so I need to create another request to get the actors names (serveurGLPI/apirest.php/user/user_id") but when I'm using a session_token of a self-service profile for example I don't have permission to access the users list.
So is there a solution that I can work with, I'm really in need to solve  this problem to get the actors names even when the user don't have permission to access the users list,

appreciate any help smile

Last edited by aziz (2021-09-29 12:33:31)

Offline

#2 2021-09-29 14:42:57

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,287

Re: ticket actors (if User can't acces users list )

as a workaround I see 2 ways :

create a profil that can only  read users, once you get Ticket and User ID switch to this profile, get user name with  apirest.php/user/user_id  and switch back to self-service profile.

or create a special user with a profile that can read users name, log with self-service user and get session token#1  then once you get user id, log with the special user and its token, get  session token #2 get user name, kill session #2 and continue working with session token #1


Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9

Offline

Board footer

Powered by FluxBB