UserManagement Component — sgcHTML | eSeGeCe

UserManagement

TsgcHTMLComponent_UserManagement — a user administration table with avatar, roles, status, search and a per-row actions dropdown, in Delphi, C++ Builder and .NET.

TsgcHTMLComponent_UserManagement

Add users with AddUser (or bind a dataset), pick which columns and row actions to expose, then read the HTML property.

Component class

TsgcHTMLComponent_UserManagement

Renders

Toolbar + Bootstrap 5 table + actions dropdown

Languages

Delphi, C++ Builder, .NET

Add users, render it, handle actions

Call AddUser for each account, read HTML for the table, then authorize and apply any action received over the WebSocket channel with ProcessUserAction.

uses
  sgcHTML_Component_UserManagement;

var
  oUsers: TsgcHTMLComponent_UserManagement;
  oUser: TsgcHTMLUser;
begin
  oUsers := TsgcHTMLComponent_UserManagement.Create(nil);
  try
    oUsers.TableID := 'users';
    oUsers.AllowImpersonate := True;
    oUsers.AllowDelete := True;

    oUser := oUsers.AddUser('u1', 'ana.torres', 'ana@example.com');
    oUser.DisplayName := 'Ana Torres';
    oUser.Roles := 'admin,editor';
    oUser.Status := usActive;
    oUser.LastLogin := '2026-07-15 09:12';

    oUsers.AddUser('u2', 'marc.bell', 'marc@example.com').Status := usInvited;

    WebModule.Response := oUsers.HTML;   // toolbar + table + inline script
  finally
    oUsers.Free;
  end;
end;

// Server-side handler for an action received over WebSockets.
// ALWAYS verify the acting user is authorized before applying it:
oUsers.ProcessUserAction('userDisable', 'u2');
// includes: sgcHTML_Component_UserManagement.hpp

TsgcHTMLComponent_UserManagement *oUsers = new TsgcHTMLComponent_UserManagement(NULL);
try
{
  oUsers->TableID = "users";
  oUsers->AllowImpersonate = true;
  oUsers->AllowDelete = true;

  TsgcHTMLUser *oUser = oUsers->AddUser("u1", "ana.torres", "ana@example.com");
  oUser->DisplayName = "Ana Torres";
  oUser->Roles = "admin,editor";
  oUser->Status = usActive;
  oUser->LastLogin = "2026-07-15 09:12";

  oUsers->AddUser("u2", "marc.bell", "marc@example.com")->Status = usInvited;

  String html = oUsers->HTML;   // toolbar + table + inline script

  // Server-side handler for an action received over WebSockets:
  oUsers->ProcessUserAction("userDisable", "u2");
}
__finally
{
  delete oUsers;
}
using esegece.sgcWebSockets;

var users = new TsgcHTMLComponent_UserManagement();
users.TableID = "users";
users.AllowImpersonate = true;
users.AllowDelete = true;

var user = users.AddUser("u1", "ana.torres", "ana@example.com");
user.DisplayName = "Ana Torres";
user.Roles = "admin,editor";
user.Status = TsgcHTMLUserStatus.usActive;
user.LastLogin = "2026-07-15 09:12";

users.AddUser("u2", "marc.bell", "marc@example.com").Status = TsgcHTMLUserStatus.usInvited;

string html = users.HTML;   // toolbar + table + inline script

// Server-side handler for an action received over WebSockets.
// ALWAYS verify the acting user is authorized before applying it:
users.ProcessUserAction("userDisable", "u2");

Key properties & methods

The members you reach for most often.

Adding users

AddUser(aId, aUserName, aEmail) appends a row and returns the TsgcHTMLUser so you can set DisplayName, Roles, Status, LastLogin and AvatarURL.

Dataset binding

LoadFromDataSet(aDataSet, aIdField, aUserNameField, aEmailField, aRolesField, aStatusField) populates the table and remembers the mapping for later refreshes.

Status & roles

TsgcHTMLUserStatususActive, usInvited, usSuspended, usDisabled — renders as a colour badge; Roles is a comma-separated list rendered as badges.

Row actions

Every row's dropdown offers Edit / Disable-Enable / Reset password; AllowImpersonate and AllowDelete add the more sensitive actions.

Toolbar & columns

ShowSearch, ShowAddButton (with AddCaption / SearchPlaceholder) control the toolbar; ShowRoles, ShowStatus, ShowLastLogin, ShowActions and PageSize control the table.

Security

Every action travels client-to-server as JSON (and fires sgcUserManagement:action). ProcessUserAction must only run after the host verifies the acting user is authorized for that action.

Keep exploring

Online HelpFull API reference and usage guide for this component.
All sgcHTML ComponentsBrowse the full feature matrix of 80+ components.
Download Free TrialThe 30-day trial ships the 60.HTML demo projects.
PricingSingle, Team and Site licenses with full source code.

Ready to Get Started?

Download the free trial and add a user administration table to your Delphi, C++ Builder or .NET admin panel.