Skip to main content
Solved

What happens if a user already has a role and you use the Add a Role to a User API?

  • February 7, 2022
  • 2 replies
  • 24 views

DannyPancratz
Forum|alt.badge.img+9

Based on the API documentation, I’m expecting that it’ll just error out and not cause any issues. 

Does anyone know for sure that’s the case? My colleagues asked to ensure that it won’t “double up” on the role or cause any issues with the users’ data. 

 

Best answer by SmartlyGreg

@DannyPancratz actually it looks like there is not even an error if you add a role that the user already has. The response is: Status 200 OK and “Done”.

 

2 replies

SmartlyGreg
Forum|alt.badge.img
  • Helper ⭐️⭐️⭐️
  • Answer
  • February 8, 2022

@DannyPancratz actually it looks like there is not even an error if you add a role that the user already has. The response is: Status 200 OK and “Done”.

 


Blastoise186
Forum|alt.badge.img
  • Helper ⭐️⭐️⭐️
  • February 8, 2022

Personally, that would make sense to me as well. The last thing you want is to cause your scripts to error out because you tried to give me the same role I already had, so it’s easier just to say it’s done and move on.

Technically speaking, inSided could add a status for “already done” but that starts to complicate things for no real benefit.