cancel
Showing results for 
Search instead for 
Did you mean: 
Patrick_Ramser
Star Contributor
Star Contributor

OnBase 14 has already been a powerhouse when it comes to feature requests from customers. This is especially true when it comes to not just API features, but those in the user administration space. We've introduced the likes of template user generation, template user group generation, and even caching changes to make it easier for developers to access user data.

Beyond all that, we've recently included something quite simple, but much needed: the ability to rename a user account via the Unity API.

Implementation

Given that this feature falls in line with our existing API method to updating an existing user, we've included a new property called "UserName" on our EditableUserProperties object. For the unfamiliar, this object is used with the UserAdministration.ChangeUserProperties method for the basic update of a user's information.

EditableUserProperties already contains properties including -

  • E-mail address
  • Real name
  • Primary user group
  • Password
  • Named client license
  • Named Workflow license
  • Named WorkView license

-but will now also include the user's name as well.

Example

Let's say you want to change an existing name in OnBase to something more simple. Maybe you want to strip out my first name and just use an initial so it falls in line with everyone else's formatting in your current system.

To start, we'll need to create a new instance of the EditableUserProperties object using Unity API's user administration portion. I should also mention that user administration is a core feature, so it'll be accessible off of the application object's core.

UserAdministration admin = app.Core.UserAdministration;var editedProps = admin.CreateEditableUserProperties();

This object will allow us to set the user name-

editedProps.UserName = "PRAMSER";

-just before sending up the changes by calling into ChangeUserProperties and specifying the target user to change.

User user = admin.GetUsers().Find("PATRICK_RAMSER");admin.ChangeUserProperties(user, editedProps);

The example provided may be simple, but that's more due to design rather than anything. We've tried to keep the API organized in a way that makes it easy for you to do exactly what you want to do easily once you know your way around.

Specifics

We've tried to keep this enhancement tight when it comes to security since it can radically change user access for a given system where it's being used.

By default, we block the modification of both the MANAGER, ADMINISTRATOR, and service users since we always expect those to be constant. Locked user objects restrict this feature also we can't be sure the user is not being modified in another client if it's locked. If you get past the previous restrictions, we'll fall to checking the User Account Administrator configuration right. This is how it works in the other clients, so we've mimicked that behavior here.

In addition, if this feature generally worries you, we've created specific Unity API logs that are added to the existing transaction log. This way you can track exactly who's using this feature and when it's happening.

We've also included some specific, new exception cases you may want to consider in your application. These include  user name length going over 75 characters and using a name that already exists.

In Conclusion

Continuing our theme of improving user administration in OnBase 14 should prove to be powerful for you and your solution. Now, not only do you have the ability to create users and user groups in new ways, but you have the key to having those users appear exactly how you want them to after creation. We don't know know exactly how developers will use this feature going forward, but we look forward to seeing interesting implementations ranging from maintenance to user manipulation outside of the clients.

As always, if you have any questions, let us know in the comments. Next time, we're going to check out our new Hyland SDK for this year!