Adding a user to an Internal User Source

Hello all,

I am currentely trying to add a user to an Internal UserSource from a script but I cannot figure how to set the properties (FirstName, username, …) of the future user to be added in the UserSource.
Here is a part of my code:

from com.inductiveautomation.ignition.gateway.authentication.impl import InternalUserSource
from com.inductiveautomation.ignition.gateway import SRContext
from com.inductiveautomation.ignition.common.user import BasicUser
from com.inductiveautomation.ignition.common.gui import UICallback
from com.inductiveautomation.ignition.common.config import BasicProperty
import java.io.Serializable
import java.util.Collection
import java.util.ArrayList as ArrayList
import java.util.Locale as Locale

class toSerialized(java.io.Serializable):
	def __init__(self, value=0):
		self.value = value

profileName = 'default'
roles = ArrayList()
roles.add('User')
idUser=1

newUser = BasicUser(profileName,toSerialized(idUser),roles)

firstName = BasicProperty()
firstName.setDefaultValue("Amarth")
newUser.FirstName = firstName #Fails because the property is set to static final in the User Interface

theGatewayContext = SRContext.get()
ignitionInternalUserSource = InternalUserSource(theGatewayContext,0,profileName,15000)
newLocale = Locale('fr')
newUICallback = UIResponse(newLocale)

ignitionInternalUserSource.addUser(newUser, newUICallback)

I’m not really sure that it is the way it has to be done but i can only see this addUser() method from InternalUserSource to add a user.

Anyone has a hint about how to do this ?

Hum. I may have posted in the wrong forum.

Perhaps it should best fitted in “Ignition Problems” as it is not a 3rd Party Module but a GatewayScript.