PureConnect

Discussion Thread View
Expand all | Collapse all

IceLib - User License Add(s) and Removal(s)

  • 1.  IceLib - User License Add(s) and Removal(s)

    GCAP Member
    Posted 09-15-2020 11:36
    I see in the Statistics library that we can see some licening information and on the user we can see licensing that the user has but is there a way with IceLib SDK that we can programmatically add/Remove specific licensing to a User?  If so can someone give a snippet of a hint of how its accomplished.

    Thanks in advance.
    #Handlers
    #Integrations
    #SystemAdministration
    #Unsure/Other

    ------------------------------
    Raleigh Beringer
    Gerber Life Insurance
    ------------------------------


  • 2.  RE: IceLib - User License Add(s) and Removal(s)

    GCAP Member
    Posted 09-30-2020 12:02
    I did this a couple of years ago, but with ICWS (and at a different company).  I'll see if I can find a snippet of code.

    ------------------------------
    Tim Cannon
    ------------------------------



  • 3.  RE: IceLib - User License Add(s) and Removal(s)

    Posted 10-01-2020 02:02
    You can read/modify the licenses of a user in the property "License" of the UserConfiguration. (ININ.IceLib.Configuration.UserConfiguration).

    ------------------------------
    ---------------------------------------------
    Hans-Gerd Sandhagen
    Software Developer
    Fiebig GmbH
    ---------------------------------------------
    ------------------------------



  • 4.  RE: IceLib - User License Add(s) and Removal(s)

    Posted 02-10-2021 14:07
    I know this is an old thread but wanted to add a comment. This can be done, I've been working with it this week. There may be better ways but:

    Iterating through a list of UserConfigurations:
    
    
    // First declared the license I wanted, I created a variable for an additional license for my convenience
    ConfigurationId I3_ACCESS_RECORDER_QUALITYMONITORING_AGENT      = new ININ.IceLib.Configuration.ConfigurationId("I3_ACCESS_RECORDER_QUALITYMONITORING_AGENT");
    
    ..
    ..
    ConfigurationManager _configurationManager = ConfigurationManager.GetInstance(session);
                                    UserConfigurationList userConfigurationList = new UserConfigurationList(_configurationManager);
                                    QuerySettings<UserConfiguration, UserConfiguration.Property> newQuerySettings = userConfigurationList.CreateQuerySettings();
                                    newQuerySettings.SetPropertiesToRetrieve(
                                                  UserConfiguration.Property.License_AdditionalLicenses
                                                                              );
                                    newQuerySettings.SetRightsFilterToAdmin();
                                    newQuerySettings.SetFilterDefinition(UserConfiguration.Property.Id, user.UserName, FilterMatchType.Exact);
                                    userConfigurationList.StartCaching(newQuerySettings);
    
                                    foreach (UserConfiguration configurationObject in userConfigurationList.GetConfigurationList())
                                    {
    
    configurationObject.License.AdditionalLicenses.Value.Add(I3_ACCESS_RECORDER_QUALITYMONITORING_AGENT)
    
                                        configurationObject.Commit();
                                    }
                                    userConfigurationList.StopCaching();​


    ------------------------------
    James Dunn
    Pitney Bowes Inc.
    ------------------------------