Forum Discussion

Nathan_H_'s avatar
Nathan_H_
Ideator I
5 years ago
Solved

Add User Identity

Good day all.  We have created an Identity called sm_AddUsers (v11 SP10).  We have a separate team that is taking over the responsibilities of adding users to the system and they do not require any o...
  • Nathan_H_'s avatar
    5 years ago

    Well, it looks like it was fixed with FM.  One of the team members contacted me this morning to let me know that she was able to add a user.  I guess it just took a little bit for everything to work.

  • Nathan_H_'s avatar
    5 years ago

    Good day all.  Just a follow up with this.  Josh Jerge (Aras SUpport) helped to modify a method that we have for allowing Users to be added.  I thought I would post it here in case someone else wants to use it.

    Name:  UpdateUserForSSO
    Execution:  World
    Script:

    'attach this to the OnAfterAdd and OnAfterUpdate events for the USER itemtype
    'See myinnovator.com issue IR-006086.
    'MethodTemplateName=VBScriptMainUpgrade;

    Sub MethodMainSubroutine()

    Const pmIdentityNm As String = "Administrators"
    Dim pmIdentity As Aras.Server.Security.Identity = Aras.Server.Security.Identity.GetByName(pmIdentityNm)

    Dim pmIdentityWasGranted As Boolean = Aras.Server.Security.Permissions.GrantIdentity(pmIdentity)
    If Not CCO.Permissions.UserHasRootOrAdminIdentity() Then
    Exit Sub
    End If

    Dim cfgpath As String = "/Innovator/ClientLogon"
    Dim cfg As XmlElement = CType(CCO.Cache.GetCacheInfo("ApplicationXML").SelectSingleNode(cfgpath), XmlElement)

    If IsNothing(cfg) OrElse cfg.GetAttribute("shared_secret") = "" Then
    Exit Sub
    End If

    CCO.ApplyItem.ExecuteMethodByName(inDom, outDom, "Reset All Auth Passwords", True)
    If pmIdentityWasGranted Then
    Aras.Server.Security.Permissions.RevokeIdentity(pmIdentity)
    End If

    End Sub